Configuring Siebel Business Applications > Configuring Special-Purpose Applets > Configuring a Hierarchical List Applet >
Configuring a Hierarchical List Applet to Use External Data
This topic describes how to configure a hierarchical list applet to use external data. To develop this example, do the following tasks:
- Creating the Virtual Business Component
- Creating the Business Service for the Hierarchical List Applet
- Implementing the Customization
You can configure a hierarchical list applet to get external data from a virtual business component. A hierarchical list applet does not require special configuration on a business component other than a properly set Hierarchy Parent Field property. More configuration is required for a virtual business component. Creating the Virtual Business Component
You start by creating the virtual business component. To create the virtual business component
- In the Object Explorer, click Business Component.
- In the Business Components list, create a new business component using values from the following table.
|
|
Hierarchy Parent Field |
Id |
- In Business Components list, right-click the record you created in Step 2, and then click Edit Server Scripts.
- In the Scripting Language dialog box, choose eScript, and then click OK.
- In the BusComp Script window, expand the BusComp tree, and then click BusComp_PreInvokeMethod.
- In the script editing window, remove the existing script, and then enter the following script:
function BusComp_PreInvokeMethod (MethodName) { TheApplication().Trace(this.Name() + ".PreInvoke." + MethodName + "()"); return (ContinueOperation); }
- In the BusComp tree, click BusComp_InvokeMethod, remove the existing script, and then enter the following script:
function BusComp_InvokeMethod (MethodName) { TheApplication().Trace(this.Name() + ".Invoke." + MethodName + "()"); }
- In the Object Explorer, expand the Business Components tree, and then click Field.
- In the Fields list, add fields to your virtual business component using values from the following table.
|
|
Has Children |
DTYPE_BOOL |
Is Expanded |
DTYPE_BOOL |
Last Child Info |
DTYPE_TEXT |
Outline Number |
DTYPE_TEXT |
Creating the Business Service for the Hierarchical List Applet
In this topic, you create the business service for the hierarchical list applet. To create the business service for the hierarchical list applet
- Display the Business Service Server Script object type.
The business service server script is a child of the business service. For more information, see Displaying Object Types You Use to Configure Siebel CRM.
- In the Object Explorer, click Business Service.
- In the Business Services list, add a new business service using values from the following table.
|
|
Name |
Hierarchical List Service |
Server Enabled |
Check mark |
- In the Object Explorer, expand the Business Service tree, and then click Business Service Server Script.
- In the Business Service Server Scripts list, add a new record using values from the following table.
|
|
Name |
Init |
Program Language |
JS |
Sequence |
1 |
Script |
Enter the following script: function Init (Outputs) { with( Outputs ) { SetProperty ("Parent Row Id", ""); SetProperty ("Amount", ""); SetProperty ("Description", ""); // SetProperty ("Has Children", "N"); // SetProperty ("Is Expanded", "N"); // SetProperty ("Outline Number", "0"); // SetProperty ("Last Child Info", ""); } return( CancelOperation ); }
|
You can copy the text from this book, and then paste it into the Script property. To view the correctly formatted script, right-click Hierarchical List Service in the Business Services list, choose Edit Service Scripts, expand the general tree, and then click Init.
- In the Business Service Server Scripts list, add a new record using values from the following table.
- In the Business Service Server Scripts list, add a new record using values from the following table.
|
|
Name |
Service_PreInvokeMethod |
Program Language |
JS |
Sequence |
3 |
Script |
Enter the following script: function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
TheApplication().Trace( this.Name() +".PreInvokeMethod( " + MethodName + " )");
switch( MethodName )
{
case "Init":
return( Init (Outputs) );
case "Query":
return( Query (Inputs, Outputs) );
}
return (ContinueOperation);
}
|
- Add code to the Query method of the business service so that the method provides output that is meaningful for these fields:
- To maintain the values appropriately, add code to the Update method.
The Update method is specific to your custom implementation and requires a mechanism to update the records of the virtual business component. The exception is if all records are read-only, then no Update method is required.
About Last Child Info
The output for Last Child Info in this example is a string of three bits that Siebel CRM displays for each level in the hierarchy if more records exist. Consider the test values in the Query method for this example. The following situations apply for a tree that includes three levels:
- If an item exists in the tree that is at position 1.3.2, and if item 1.3.3 does not exist, then the third bit is 1, which you can think of as xx1. Otherwise the third bit is 0, which you can think of as xx0.
- If the parent record at position 1.3 is the last child, then the second bit is 1, which you can think of as x1x. If item 1.4 does not exist in the tree, then Siebel CRM considers the record as the last child.
- If the grandparent record at position 1 is the last child, and if item 2 does not exist in the tree, then the first bit is 1, which you can think of as 1xx.
Implementing the Customization
In this topic, you implement the customization. To implement the customization
- Apply any modifications that you made in the base table to the SRF file.
- If you defined a new screen, then add the screen to the application screen object.
- Compile your modifications.
- In the Siebel client, add the view to the list of views, and then add an appropriate responsibility so that the user can access this view.
- Test your modifications.
|