Example: Object Validation

This example demonstrates how you can perform validations of all fields by using the CanPost event procedure. For example, this code segment ensures that a user cannot reject a defect without adding a comment.

In this example, a user may not post a defect where the defect status (BG_STATUS) has been changed to Rejected unless some explanatory text has been typed in the R&D Comment field (BG_DEV_COMMENTS).

Add the code to the Bug_CanPost event procedure so that the check is performed when the user attempts to submit the defect.