Siebel CRM Desktop for IBM Notes 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

  1. Make sure the InitValidators procedure is defined in the class that the form references.

    For more information, see Preparing to Use Validation.

  2. Open IBM Domino Designer, open the SBL.Forms script library, and then add the following code to the class that the form references:

    vld.ValidateUniqueFields fields_array_ex, ids_array_ex,boolean_skip_empty_fields,validation_message, ""

    where:

    • fields_array_ex is an ArrayEx of fields. This array must be unique.
    • ids_array_ex is an ArrayEx of control identifiers that Siebel CRM Desktop highlights in the client if the validation fails.
    • skip_empty_fields is aparameter that determines if CRM Desktop ignores empty fields when it compares records. You can set it to one of the following values:
      • true. Ignore empty fields.
    • false. do not ignore empty fields.validation_message is a string constant that contains the message that CRM Desktop displays in the client if the validation fails.

      For example, the following code makes sure the user enters an opportunity name that is unique for a given account:

    vld.ValidateUniqueFields NewSmartArray().Add("Name").Add("CRMDAccountId"), NewSmartArray().Add("Name").Add("CRMDAccountId"), False, MSG_OPPORTUNITY_NAME_ACCOUNT_NOT_UNIQUE, "

    where:

    • NewSmartArray().Add("Name").Add("CRMDAccountId") identifies the fields that, when combined, must be unique. In this example, the Name field plus the Account Id field constitutes this unique combination.
    • NewSmartArray().Add("Name").Add("CRMDAccountId") 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.
    • False instructs CRM Desktop to not ignore validation for an empty field.
    • MSG_OPPORTUNITY_NAME_ACCOUNT_NOT_UNIQUE identifies the string constant that contains the text for the message that CRM Desktop displays in the client if the validation fails.

      For more information, see Opening IBM Domino Designer.

  3. Test your changes and then republish the customization package.

    For more information, see Republishing Customization Packages.

Siebel CRM Desktop for IBM Notes Administration Guide Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.