Adding Default Values to Fields

This topic describes how to configure Siebel CRM Desktop to add a default value to a field when the user creates a new record. The example in this topic configures Siebel CRM Desktop to add the following default value to the Opportunity Name field:

CRM Opportunity

For more information, see Customizing Defaulting.

To add a default value to a field

  1. Use a JavaScript editor to open the business_logic.js file.

  2. Add the following code to the end of the create_siebel_meta_scheme2 function:

    scheme.objects.get_object("object_type").get_field("field_name")[“default_sourc
    e“] = default_value;
    

    where:

    • object_type is the name of the object type identifier of the object type that resides in the siebel_basic_mapping.xml file. This file includes 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 Field Mapping.

    • field_name is the name of a field that resides in the object type definition in the siebel_basic_mapping.xml file.

    • default_source identifies the source for the default value. For more information, see Setting Default Values.

    • default_value defines the default value that Siebel CRM Desktop adds.

    For this example, you add the following code:

    scheme.objects.get_object("Opportunity").get_field("Name")["initial_value"] = 
    "CRM Opportunity";
    
  3. Save and close the business_logic.js file and then test your work.

  4. Republish the customization package.

    For more information, see Republishing Customization Packages.