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

Updating One Field If the User Modifies Values In Another Field


You can configure Siebel CRM Desktop to update the value in one field if the user changes the value in another field. This functionality is known as on field update. The example in this topic configures CRM Desktop to do the following work:

  • If the name of the opportunity is Test, then set the Lead Quality to 5-Poor.
  • If the name of the opportunity is not Test, then set the Lead Quality to 3-High.

To update one field if the user modifies values in another field

  1. Open IBM Domino Designer, and then open the (SBL)form:opportunity form,

    For more information, see Opening IBM Domino Designer.

  2. Click the Name field in the (SBL)form:opportunity form.
  3. In the Objects tab, locate and choose the onChange event.
  4. From the Run drop-down list, choose the Client option, and then choose the IBM Notes Script option.
  5. Add the following code:

    m_FormHandler.FormManager.GetControl("Name").OnChange.Raise Args()

    where:

    • m_FormHandler is an instance of the FormOpportunityEx class.
  6. Save your changes.
  7. Open the SBL.Forms script library.
  8. To create the CallbackOpportunityNameOnChange class, add the following code:

    '===========================================================================
    ' CallbackOpportunityNameOnChange
    ' Class that represents
    '===========================================================================
    Public Class CallbackOpportunityNameOnChange As CallbackObject
    Private m_Doc As DocumentEx

    'Comments for New
    Sub New(doc As DocumentEx)
      Set m_Doc = doc
    End Sub
    'Comments for Invoke
      Public Function Invoke(params As DynamicArguments)
        Dim NameValue As String
        NameValue = m_Doc.SafeProperty("Name", "")
        If NameValue = "Test" Then
          m_Doc.Property("LeadQuality") = "[!loc:lang_lead_quality_poor:loc!]"
        Else
          m_Doc.Property("LeadQuality") = "[!loc:lang_lead_quality_high:loc!]"
        End If
      End Function
    End Class

    This code defines the callback that CRM Desktop sends if the user modifies the value of the Lead Quality field. CRM Desktop uses the following localization macros in this class for each value that this field can contain:

    [!loc:lang_lead_quality_poor:loc!]
    [!loc:lang_lead_quality_high:loc!]

    If you use these macros, then you must also modify the Ln_package_res.xml file as described in Step b. You can also hard code these values to 5-Poor and 3-High.

  9. In the FormOpportunityEx class, switch to the PostOpen function, and then locate the following code:

    Dim ControlStatus As New ControlEditable ("Status", Me.Form)

  10. Add the following code immediately after the code you located in Step 9:

    Dim ContolName As New ControlEditable("Name", Me.Form)
    Dim NameCallback As New CallbackOpportunityNameOnChange (Me.DocumentEx)
    ControlName.OnChange.Connect NameCallback

    where:

    • Dim ContolName As New ControlEditable("Name", Me.Form) creates a virtual control.
    • Dim NameCallback As New CallbackOpportunityNameOnChange (Me.DocumentEx) creates the callback for the class that you added in Step 8.
    • ControlName.OnChange.Connect NameCallback signs the callback that CRM Desktop runs for the control.
  11. 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.