Siebel CRM Desktop for IBM Notes Administration Guide > Customizing Picklists > Process of Creating Dynamic Picklists That Use a SalesBook Control >

Modifying the Business Logic and Testing Your Work


This task is a step in Process of Creating Dynamic Picklists That Use a SalesBook Control.

In this topic you modify the business logic and test your work.

To modify the business logic and test your work

  1. Add a direct link description in the Business logic:
    1. Open the SBL.BusinessLogic script library in the IBM Domino Designer.
    2. Locate the CreateMetaScheme function.

      This function sets up the relationships between objects.

    3. Locate the Opportunity section in the CreateMetaScheme function.
    4. Create the link definition for the Fulfillment Center object relation with the Opportunity object.

      The following helper function should be used:

    MetaSchemeHelpper.AddDirectLink(linkFrom As String, linkTo As String, fieldName As String, fieldStatusName As String, tag As String, removeOnUnlink as Boolean)

    where:

    • linkFrom specifies the object type where the link field resides.
    • linkTo specifies the object type that the link field references.
    • fieldName specifies the name of the field which stores the ID for the linked object.
    • fieldStatusName specifies the name of the field which stores a Status of linked object (Unsaved or Deleted).
    • tag specifies the tag name for link.
    • removeOnUnlink specifies that the linked document should be removed in case of unlinking from the parent object (True) or remains in the local storage as a separate object (False).

      In this example, you add the following code:

    Call Helper.AddDirectLink("Opportunity", "Fulfillment Center", "JVDFulfillmentCenterId", "ObjectStatus", LINK_TAG_DIRECT, False);

    1. Save and close the SBL.BusinessLogic script library.
  2. Create a new view design element for SalesBook and lookup purposes:
    1. Create a new view with the following name in IBM Domino Designer:

      (SBL)\salesbook:FulfillmentCenters

    2. Enter the following View Selection formula:

    SELECT CRMDType = "Fulfillment Center"

    1. Modify parameters of the first view column:

    Title: display_name
    Sort: None
    Column Value: @Trim(@ReplaceSubstring(Name; "|" : @NewLine; "¦" : " ")) + "|" + @Text(@DocumentUniqueID)
    Hide Column: yes

    1. Add the second column with the following parameters:

    Title: Fulfillment Center Name
    Sort: Ascending
    Column Value: Name
    Hide Column: no

    1. Enter the following code into the Queryopendocument event:

    Sub Queryopendocument(Source As Notesuiview, Continue As Variant)
    Continue = False
    End Sub

    1. Save and close the view design element.
  3. Add the picklist control to the Opportunity form handler:
    1. Open the SBL.Forms script library in the IBM Domino Designer.
    2. Locate the PostOpen procedure in the FormOpportunityEx class.
    3. Input the following code anywhere before calling InitDescriptors:

    Dim FulfillmentController As New DescriptorControllerLookup("JVDFulfillmentCenterId", "Fulfillment Center", LINK_TAG_DIRECT, "sbFulfillmentButton", "(SBL)\salesbook:FulfillmentCenters ", "")
    With FulfillmentController
    .Caption = "Fulfillment Centers"
    .ChooseFrom = "Select from Fulfillment Centers"
    End With
    Set Me.addDescriptor = FulfillmentController

    1. Save and close the SBL.Forms library
  4. Add the picklist control to the Opportunity form layout:
    1. Open the (SBL)form:opportunity form in IBM Domino Designer.
    2. Add a Fulfillment Center label where you need it on the form layout.
    3. Add a new field with the following parameters:

    Name: JVDFulfillmentCenterId
    Editable: yes
    Type: Dialog list
    Show field delimiters: no
    Allow values not in list: no

    1. Input the following Choices formula for this field:

    sblist:= @DbColumn("":"NoCache"; ""; "(SBL)\\salesbook:FulfillmentCenters "; 1);
    thisV := @ThisValue;
    sblistsize := 2 + 2 * @Elements(sblist) + 2 * @Sum(@Length(sblist)) - @Sum(@Length(@Ascii(sblist; [AllInRange])));
    maxlistsize := 64000;
    @If(sblistsize > maxlistsize; @True; @Return(sblist));
    thisLabel := @If(thisV = ""; ""; @Trim(@Left(sblist; thisV)));
    nmax := @Max(@Length(@Trim(@Left(sblist; "|"))));
    n := 0;
    @DoWhile(n := n + 1;
    abcLabel := @If(thisV = ""; ""; @Left(thisLabel; n));
    abcN := @If(thisV = ""; 1; n + 1);
    abclist := @Unique(@Left(sblist; abcN));
    abclist := @If(thisV = ""; abclist; @Transform(abclist; "entry"; @If(@Matches(entry; @Left(abcLabel; 1) + "*" ); entry; @Nothing )));
    plist := @Transform(sblist; "entry"; @If((abcLabel != "") & @Matches(entry; abcLabel + "*"); entry; @IsMember(@Left(entry; abcN); abclist); @Do(abclist := @Replace(abclist; @Left(entry; abcN); @Nothing) ; entry); @Nothing));
    plistsize := 2 + 2 * @Elements(plist) + 2 * @Sum(@Length(plist)) - @Sum(@Length(@Ascii(plist; [AllInRange])));
    (plistsize > maxlistsize) & (n < nmax));
    plist

    1. Enter the following code into the Onchange event of the field:

    Sub Onchange(Source As Field)
    Call cOnChange(m_FormHandler, "JVDFulfillmentCenterId")
    End Sub

    1. Add the new button with the following IBM Notes script code in the Click event:

    Sub Click(Source As Button)
    Call cOnClick(m_FormHandler, "sbFulfillmentButton")
    End Sub

    1. Save and close the Opportunity form.
  5. Upload and publish your work. Do Uploading and Testing Your Static Picklist.
  6. Test your work:
    1. Open the client and then navigate to the Opportunity form.
    2. Make sure the form displays the Center picklist.
    3. Type text into the Center picklist.

      As you enter each character of text the Center picklist must display different values in the autocomplete entries. These entries must change according to the character you enter. For example, if you enter the letter B, then the field must display entries that begin with the letter B.

    4. Click the button that opens the SalesBook dialog box.

      CRM Desktop must display the SalesBook dialog box. It must include a list of fulfillment centers. For example:

      • Concord Fulfillment Center
      • Copy Center
      • Marketing Department
      • And so on
Siebel CRM Desktop for IBM Notes Administration Guide Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.