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
- Configure the default value:
- Use a JavaScript editor to open the business_logic.js.
- Locate the create_siebel_meta_scheme2 function.
- 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:
scheme.objects.get_object("Opportunity").get_field("Name")["initial_value"] = "CRM Opportunity";
- Save and then close the business_logic.js file.
- Test your work:
- Open the Siebel CRM Desktop client, and then navigate to the opportunity form.
- Create a new opportunity.
- 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.
|