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
Use a JavaScript editor to open the business_logic.js file.
Locate the following function:
create_siebel_meta_scheme2
This function sets up the relationships between objects.
Locate the following section in the create_siebel_meta_scheme2 function:
//Direct Links
For more information, see Preventing Users From Removing Links Between Object Types.
Create the link definition for the Fulfillment Center object relation with the Opportunity object. You add the following code to the Direct Links section:
function add_direct_link(from_type, to_type, link_field, required_link, view_ids, refresh_required, status, primary_on_parent)
where:
from_type specifies the object where the link field resides.
to_type specifies the object that the link field references.
link_field specifies the name of the field for the link.
required_link specifies if the link is required.
view_ids specifies the Id of the view to use in the salesbook control.
refresh_required specifies to refresh the parent object. If you specify link_fields, then you must specify refresh_required.
status specifies the status field for the from type.
primary_on_parent is not used in this example.
In this example, you add the following code:
add_direct_link("Opportunity", "Fulfillment Center", "JVD Fulfillment Center Id", false, ["lookup:fulfillment-centers"], true, "OpportunityStatus");
Locate the following function:
opportunity_form
To enable the autocomplete list and salesbook button on the form, you add JavaScript as part of the opportunity_form function.
Locate the following section in the opportunity_form function:
//CONTROLS EVENTS
Add the following code to the section that you located in step 6:
register_autocomplete_control(ctx, "Fulfillment Center","jvd_fulfillment_center_id","btn_fulfillment_center_select");
This code does the following:
Enables the autocomplete list.
Uses the ctx object as input.
Specifies to store the possible values in the Fulfillment Center type.
Specifies jvd_fulfillment_center_id as the form Id for the field that Siebel CRM Desktop uses with the autocomplete list.
Specifies btn_fulfillment_center_select as the Id of the button that the user clicks to display the SalesBook dialog box.
For more information, see Registering Autocomplete Controls.
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 auto complete 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.
Siebel CRM Desktop must display the SalesBook dialog box. This dialog box must include a text entry field that allows the user to enter the name of the fulfillment center. It must also include a list of fulfillment centers. For example:
Concord Fulfillment Center
Copy Center
Marketing Department
And so on