Bookshelf Home | Contents | Index | Search | PDF |
Siebel eSales Administration Guide > Shopping Service API > User Action Methods >
OrderTemplate
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
Expected Preconditions Before the Method Can Be Called
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 40 and Table 41.
The OrderTemplate method has the arguments shown in Table 42.
Pseudo-Algorithm
- 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.
Bookshelf Home | Contents | Index | Search | PDF |
Siebel eSales Administration Guide Published: 18 April 2003 |