Siebel CRM Desktop for Microsoft Outlook Administration Guide > Customizing Siebel CRM Desktop > Performing Typical Customization Work >

Adding a Default Value to a Field in Siebel CRM Desktop


This topic describes how to configure Siebel CRM Desktop to add a default value to a field when the user creates a new record. In this example, you configure Siebel CRM Desktop to add the following default value to the Opportunity field:

CRM Opportunity

To add a default value to a field in Siebel CRM Desktop

  1. Configure the default value:
    1. Use a JavaScript editor to open the business_logic.js.
    2. Locate the create_siebel_meta_scheme2 function.
    3. Add the following code to the end of the function:

    scheme.objects.get_object("object_type").get_field("field_name")["default_source"] = "default_value";

    where:

    • object_type is the object type identifier of the object type that resides in the siebel_basic_mapping.xml file. This file contains definitions for object types. Each definition includes an Id attribute. This attribute is the object type identifier that you must use for the object_type. For more information, see Customizing How Siebel CRM Desktop Maps Fields.
    • field_name is the name of a field that resides in the definition of the object type in the siebel_basic_mapping.xml file.
    • default_source identifies the source for the default value. For more information, see Setting the Source for the Default Value.
    • default_value defines the default value that Siebel CRM Desktop adds. You use the default_value variable only if you set the default_source variable to initial_value.

      For this example, you add the following code:

    scheme.objects.get_object("Opportunity").get_field("Name")["initial_value"] = "CRM Opportunity";

    1. Save and then close the business_logic.js file.
  2. Test your work:
    1. Open the Siebel CRM Desktop client, and then navigate to the opportunity form.
    2. Create a new opportunity.
    3. Verify that Siebel CRM Desktop adds the following default value to the Opportunity Name field:

      CRM Opportunity

Setting the Source for the Default Value

To identify the source of the default value, you can use one of the following values for the default_source variable:

  • initial_value. Specifies to use the value that you set for the default_value variable as the default value.
  • initial_value_res. Sets the same value as the initial_value variable except you define the default value in the package_res.xml file.
  • initial_value_fn. Uses a function that returns a value to the field. For example, to configure Siebel CRM Desktop to enter a value for a date field, you can specify a function that returns the current Windows system date.
Siebel CRM Desktop for Microsoft Outlook Administration Guide Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices.