Required fields

Required fields are window fields that must contain information in order to save a record properly. Set the Required property to True for any field that functions as a primary key or key segment. This ensures that the user enters the key information required to store the record.

Displaying required field prompts

Microsoft Dynamics GP can display prompts for required fields in a different typeface (bold, italic or both) or a different color than prompts for non-required fields. You can specify this format using the options available in the User Preferences window. Once you’ve specified the format, choose Show Required Fields from the Help menu. Required field prompts will then appear in the selected format. The following illustration shows required field prompts in bold.

[spacer]

Creating required fields

To create required fields and the corresponding prompt display, open a window’s layout and complete the following steps.

  1. Mark the field as required.

In the layout window, select the field you want to make required, then set its Required property to True.

  1. Link the prompt.

Choose Link Prompt from the Tools menu. Click the field, and drag the pointer to the prompt you want the field linked to.

Once you’ve positioned the pointer over the prompt, release the mouse button; a highlight will flash to indicate that the link was successful. Link the remainder of the required fields. When you’ve finished, choose Link Prompt again to unmark the menu item.

  1. Attach a Save button change script.

Attach a change script to the window’s Save button similar to the following example. This example uses the required() function to ascertain whether all required fields contain data. If the user hasn’t entered all required fields, the script displays a warning dialog.

if not required (form IG_Lead_Maintenance) then
	warning "Please enter all required fields before attempting to save this record.";
else
	'Lead ID' of table IG_Leads_MSTR = 'Lead ID';
	copy to table IG_Leads_MSTR;
	save table IG_Leads_MSTR;
	restart form;
	focus 'Lead ID' of window 'Lead Maintenance';
end if;

  1. Change the prompt display.

Start Microsoft Dynamics GP. Point to Setup in Tools menu and choose User Preferences. Click Display to display the User Display Preferences window. Select font options and color options you want to use for required fields. Click OK.

  1. Show required fields.

Choose Show Required Fields from the Help menu, then display your window. The prompts you linked to fields will appear in the format you specified.


Documentation Feedback