Oracle CRM On Demand Desktop Administration Guide > Customizing Oracle CRM On Demand Desktop > Process of Enabling Custom Object Synchronization in Oracle CRM On Demand Desktop >

Adding Custom Logic and Validation Rules in the Customized Microsoft Outlook Form


This topic describes how to add custom logic and validation rules for certain fields in the customized Microsoft Outlook form for Custom Object 1.

This task is a step in Process of Enabling Custom Object Synchronization in Oracle CRM On Demand Desktop.

To add custom logic and validation rules

  1. Using an XML editor, open the forms_12.xml file.
  2. Edit the <script> element as follows:

    <form id="OnDemand CustomObject1" >
      <script>
        <![CDATA[
         include("forms.js", "forms");

        var ctx = {
          "application": application,
          "ui": ui,
          "application_script": application_script,
          "form": form
        };

        var current_form = new forms.od_co1_form(forms.create_form_ctx(ctx));

        ]]>
      </script>
      <page id="General" tag="0x10A6" min_height="155" min_width="520">
        ..
        ..
      </page>
    </form>

    NOTE:  A JavaScript function called od_co1_form() is in the <script> element.

  3. Save and close the forms_12.xml file.
  4. Using a JavaScript editor, open the forms. js file.
  5. Create the od_co1_form() function, using the following example:

    function od_co1_form(ctx)

    {
      //FORM VALIDATION
      var validator = ctx.validator;
      validator.validate_empty_field("Name", "Name", "msg_co1_name_validation", false);
    }

  6. Define a new label, msg_co1_name_validation in the od_co1_form() function.

    For more information, see Defining the Validation Rules.

  7. Add the msg_co1_name_validation label to the package_res.xml file:

    <res_root>
    ..
    ..
      <!-- C01 form -->
      <str key="lbl_co1_name">Name</str>
      <str key="lbl_co1_description">Description</str>
      <str key="view_od_co1">CustomObject1</str>
      <str key="msg_co1_name_validation">CO1 Name is required.</str>..
    ..
    </res_root>

  8. Save and close the forms.js file.

Related Topics

XML Files in the Customization Package

Defining the Validation Rules

Adding Custom Logic

Oracle CRM On Demand Desktop Administration Guide, Version 5.2 Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices.