Siebel CRM Desktop for Microsoft Outlook Administration Guide > Customizing Siebel CRM Desktop > Validating the Data That Users Enter >
Making Sure Users Enter Unique Values
You can use validation to make sure the value that the user enters in a field is unique. To make sure the user enters unique values
- Make sure the form_validator object is defined.
For more information, see Preparing to Use Validation.
- Add the following code to the forms.js file:
validator.validate_unique_fields("fields_to_check","fields_to_highlight","string_key",boolean_skip_empty_fields);
where:
validator.validate_unique_fields(["Name", "AccountId"], ["opportunity","account_id"],"msg_opportunity_unique");
where:
["Name", "Account Id"] identifies the fields that, when combined, must be unique. In this example, the Name field plus the Account Id field constitutes this unique combination.
["opportunity","account_id"] identifies the form controls that CRM Desktop highlights in the client if the validation fails. In this example, it highlights the control for the opportunity name and the control for the account name.
- msg_opportunity_unique identifies the string key in the resource file that contains the text for the message that CRM Desktop displays in the client if the validation fails.
- Test your changes and then republish the customization package.
For more information, see Republishing Customization Packages.
|