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
- Add a direct link description in the Business logic:
- Open the SBL.BusinessLogic script library in the IBM Domino Designer.
- Locate the
CreateMetaScheme function.
This function sets up the relationships between objects.
- Locate the Opportunity section in the
CreateMetaScheme function.
- 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:
Call Helper.AddDirectLink("Opportunity", "Fulfillment Center", "JVDFulfillmentCenterId", "ObjectStatus", LINK_TAG_DIRECT, False);
- Save and close the SBL.BusinessLogic script library.
- Create a new view design element for SalesBook and lookup purposes:
- Create a new view with the following name in IBM Domino Designer:
(SBL)\salesbook:FulfillmentCenters
- Enter the following View Selection formula:
SELECT CRMDType = "Fulfillment Center"
- Modify parameters of the first view column:
Title: display_name Sort: None Column Value: @Trim(@ReplaceSubstring(Name; "|" : @NewLine; "¦" : " ")) + "|" + @Text(@DocumentUniqueID) Hide Column: yes
- Add the second column with the following parameters:
Title: Fulfillment Center Name Sort: Ascending Column Value: Name Hide Column: no
- Enter the following code into the
Queryopendocument event:
Sub Queryopendocument(Source As Notesuiview, Continue As Variant) Continue = False End Sub
- Save and close the view design element.
- Add the picklist control to the Opportunity form handler:
- Open the SBL.Forms script library in the IBM Domino Designer.
- Locate the PostOpen procedure in the
FormOpportunityEx class.
- 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
- Save and close the SBL.Forms library
- Add the picklist control to the Opportunity form layout:
- Open the (SBL)form:opportunity form in IBM Domino Designer.
- Add a Fulfillment Center label where you need it on the form layout.
- 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
- 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
- Enter the following code into the Onchange event of the field:
Sub Onchange(Source As Field) Call cOnChange(m_FormHandler, "JVDFulfillmentCenterId") End Sub
- 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
- Save and close the Opportunity form.
- Upload and publish your work. Do Uploading and Testing Your Static Picklist.
- Test your work:
- Open the client and then navigate to the Opportunity form.
- Make sure the form displays the Center picklist.
- 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.
- 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
|