Siebel CRM Desktop for IBM Notes Administration Guide > Customizing Siebel CRM Desktop > Validating the Data That Users Enter >

Making Sure Users Do Not Exceed the Maximum Number of Characters


You can use validation to make sure the user does not enter more than a maximum number of characters in a field.

To make sure users do not exceed the maximum number of characters

  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.ValidateFieldLength fields_array_ex, ids_array_ex, maximum_length, StrReplace(validation_message, "[comment_max_length]", maximum_length, boolean_skip_empty_fields), ""

    where:

    • fields_array_ex identifies an ArrayEx of fields. This array must be unique.
    • ids_array_ex identifies an ArrayEx of control identifiers that CRM Desktop highlights in the client if the validation fails.
    • maximum_length specifies the maximum length for the field in characters.
    • StrReplace substitutes the string message in the validation_message that contains the comment_max_length string with the maximum_length value.
    • 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 does not enter more than 1500 characters in the Comment field of an Activity:

    vld.ValidateFieldLength NewSmartArray().Add("Comments"), NewSmartArray().Add("Comments"), 1500, StrReplace(MSG_ACTIVITY_COMMENT_LENGTH, "[comment_max_length]", 1500, False), ""

    where:

  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.