Siebel CRM Desktop for Microsoft Outlook Administration Guide > XML Files Reference > XML Code to Customize Forms >

Validation Rules Tag of the forms_xx.xml File


The validation_rules tag contains descriptions of validation rules. There is no limitation on the number of validation rules that you can define. Each rule is described in a rule tag.

The validation_rules tag can include the following attributes:

  • message. Contains the message text as a value. If the validation rule that the rule tag describes fails, then Siebel CRM Desktop displays this message to the user.
  • expression. Contains the validation expression as a value. If the expression returns a false value, then the validation rule fails.

The validation_rules tag can contain the following tags:

  • expression. Performs the same function as the expression attribute. The only difference is that if you use the expression tag, then you must describe the validation expression in the CDATA section of the validation_rules tag.
  • asserted_control. Defines a control to highlight if the validation rule fails. The ID of this control is defined in the id attribute of the asserted_control tag.

Example Code of the Validation Rules Tag

The following code is an example of the validation_rules tag:

<validation_rules>

<rule message="Last Name is required." expression="item['Last Name'] != ''">

<asserted_control id="0x1000"></asserted_control>

</rule>

<rule message="Business phone value format is incorrect.">

<expression>

<![CDATA[

var phonetest = new RegExp(/\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}/);

item["Work Phone #"] != '' ? (item["Work Phone #"].match(phonetest) != null ? true : false) : true;

]]>

</expression>

</rule>

</validation_rules>

Siebel CRM Desktop for Microsoft Outlook Administration Guide Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices.