Example: Customizing a Defects Module Dialog Box
This example shows how you can customize the field layout and other field properties in the Add Defect dialog box. You can create similar code to arrange the layout of the Defect Details dialog box.
This example illustrates a solution that customizes field properties for all user groups. You can also use the script generators to customize the layout of the Defects module dialog boxes. If you use the script generators, you must perform customization separately for each user group.
This example involves the following procedures:
-
SetFieldApp
is a general purpose procedure that receives a field name and its properties as parameters, and assigns the properties to the field. See SetFieldApp. -
FieldCust_AddDefect
callsSetFieldApp
for each field in the Add Defects dialog box, to set the properties of the field. For some of the fields,FieldCust_AddDefect
checks the user group to which the current user belongs, and customizes the field properties accordingly. A call toFieldCust_AddDefect
is placed in theBug_New
event procedure. See FieldCust_AddDefect. - Rename the generated function
WizardFieldCust_Add
toFieldCust_AddDefect
and modify it as necessary. (Before you modify a generated script, you must rename it so that it is not overwritten the next time you run the script generator.) - The script generator places a call to
WizardFieldCust_Add
in the event procedureBug_New.
Change this toFieldCust_AddDefect.
- The function SetFieldApp is generated when you run the script generator. You do not need to rename or modify this function.
Note: To implement this example, you can run the Add Defect Field Customization script generator and then modify the resulting scripts.