The user-defined function FieldCust_AddDefect calls the function SetFieldApp.

The function first sets all fields to be invisible, not required, and to appear on page 100 at location 0. This ensures that if you add a new field using the Project Entities link on the Project Customization window, the layout will not be changed.

Add a call to FieldCust_AddDefect in the Bug_New event procedure so that it will be triggered when a user adds a new defect:

First, the code handles the fields that are common to all user groups. It uses conditional statements for the fields that will appear in the dialog box only for specific user groups, or that will have different properties for different users.