Siebel eSales Administration Guide > Shopping Service Methods Reference > Siebel eSales User Action Methods >
OrderTemplate Method
OrderTemplate copies all the line items from a template to the Shopping Cart. The behavior is similar to AddToCart; the difference is that when you order a template, you add several line items to the Shopping Cart. Each line item will have the quantity specified in the template. A template is a quote of type Template, so template records are a subset of quote records. Templates have a similar structure to quotes—there is a 1:1 mapping between template and quote business components:
- Quote Template to Quote
- Quote Template Item to Quote Item
- Quote Template Item XA to Quote Item XA
Preconditions for Calling the OrderTemplate Method
OrderTemplate uses field maps defined in the Shopping Service business service user properties to copy field values from Quote Template Item to Quote Item and from Quote Template Item XA to Quote Item XA. The field maps are shown in Table 25 and Table 26.
Table 25. Quote Template Item to Quote Item Field Map
|
|
Quote Template Item|Quote Item FieldMap 100 |
Product Id|Product Id |
Quote Template Item|Quote Item FieldMap 101 |
Quantity Requested|Quantity Requested |
Quote Template Item|Quote Item FieldMap 102 |
Adjusted Reference Price|Adjusted Reference Price |
Quote Template Item|Quote Item FieldMap 103 |
Base Price|Base Price |
Quote Template Item|Quote Item FieldMap 104 |
Unit Price|Unit Price |
Quote Template Item|Quote Item FieldMap 105 |
Product|Product |
Quote Template Item|Quote Item FieldMap 106 |
Product Port Id|Product Port Id |
Quote Template Item|Quote Item FieldMap 107 |
End |
Table 26. Quote Template Item XA to Quote Item XA Field Map
|
|
Quote Template Item XA|Quote Item XA FieldMap 100 |
Attribute Id|Attribute Id |
Quote Template Item XA|Quote Item XA FieldMap 101 |
Name|Name |
Quote Template Item XA|Quote Item XA FieldMap 102 |
Display Name|Display Name |
Quote Template Item XA|Quote Item XA FieldMap 103 |
Read Only|Read Only |
Quote Template Item XA|Quote Item XA FieldMap 104 |
Data Type|Data Type |
Quote Template Item XA|Quote Item XA FieldMap 105 |
LOV Type|LOV Type |
Quote Template Item XA|Quote Item XA FieldMap 106 |
Value|Value |
Quote Template Item XA|Quote Item XA FieldMap 107 |
End |
Arguments for the OrderTemplate Method
The OrderTemplate method has the arguments shown in Table 27.
Table 27. OrderTemplate Arguments
|
|
|
|
|
Template Id |
Input |
String |
Y |
Not used, as OrderTemplate is always row-sensitive. |
ReturnVal |
Output |
String |
Y |
Returns Success or Fail depending on whether AddItem succeeds or not. |
Pseudo-Algorithm for OrderTemplate
- Get the Quote Template, Quote Template Item, Quote Template Item XA, Quote, Quote Item, and Quote Item XA business components.
The Quote Template business component is already positioned on the correct record, as the OrderTemplate method is row-sensitive.
- Call the AddHeader method to make sure there is a Shopping Cart.
- Loop through each record in the Quote Template Item business component and create a corresponding record in the Quote Item business component. Use the field maps to copy fields from Quote Template Item to Quote Item, then copy the child records from Quote Template Item XA to Quote Item XA.
NOTE: As Quote Item and Quote Template Item have hierarchies, you cannot simply loop through the records in Quote Template Item and copy them to Quote Item. You need to maintain the hierarchical relationship. To do this, you need to copy the parent record before you copy its child records.
In the Shopping Service implementation, records are first loaded from Quote Template Item and a tree in the memory is generated. The tree is then traversed from the root, so the parent record is copied before the child records.
|