Siebel CRM Desktop for IBM Notes Administration Guide > Customizing Siebel CRM Desktop > Customizing Field Behavior >

Adding Postdefault Values to Fields


This topic describes how to add a value to a field if the user does not enter any data in this field when the user creates a new record. Adding a value in this way is known as adding a postdefault value. The example in this topic modifies the predefined opportunity form to make sure Siebel CRM Desktop sets the postdefault value for the Lead Quality field in the opportunity to 5-Poor if the user does not set a value for this field.

To add a postdefault value to a field

  1. Open IBM Domino Designer, and then open the SBL.Forms script library.

    For more information, see Opening IBM Domino Designer.

  2. Locate the FormOpportunityEx class.
  3. Add the following function to the end of the FormOpportunityEx class:

    'Comments for QuerySave
      Public Function QuerySave As Boolean
        QuerySave = SBLFormEx..QuerySave
        If Len(Me.DocumentEx.SafeProperty("LeadQuality", "")) = 0 Then
          Me.DocumentEx.Property("LeadQuality") = "5-Poor"
      End If

    To determine if the user set the value for the Quality field, this if statement uses the SaveProperty method of the DocumentEx property, and it returns the Quality field value:

    • If the field is empty, then the Len function returns a value of 0 and sets the value of the Quality field to 5-Poor.
    • If the field is not empty, then the empty_field_validator function returns a value of false and the code exits the if statement.
  4. (Optional) Support an environment that does not use English. You do the following:
    1. Replace the Me.DocumentEx.Property("LeadQuality") = "5-Poor" code that you added in Step 3 with the following code:

    Me.DocumentEx.Property("LeadQuality") = "[!loc:lang_lead_quality_poor:loc!]"

    where:

    • !loc:lang_lead_quality_poor:loc! is a localization macro.
    1. Add the following code to the Ln_package_res.xml file:

    <str key="lang_lead_quality_poor">5-Poor</str>

    The code you added in Step 3 works in an environment that uses English but fails in a multilingual environment because you hard-coded the field value. The localization macro allows you to retrieve a string from the resource file and to write code that is language independent.

  5. Test your changes and then republish the customization package.

    For more information, see Republishing Customization Packages.

Siebel CRM Desktop for IBM Notes Administration Guide Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.