Bookshelf Home | Contents | Index | Search | PDF |
Siebel eSales Administration Guide > Shopping Service API > Workflow Methods >
CreateOrder
CreateOrder method creates an order from the current quote. It creates a record in the Order Entry - Orders business component. It copies records from the child business component Quote Item to Order Entry - Line Items and from the grandchild business component Quote Item XA to Order Item XA.
Expected Preconditions Before the Method Can Be Called
Field maps are used to copy fields from the Quote to Order Entry - Orders, Quote Item to Order Entry - Line Items, and Quote Item XA to Order Item XA business components.
Example sample field maps are shown in Table 50. See the Shopping Service business service user properties in Siebel Tools for more details.
Arguments
The CreateOrder method has the arguments shown in Table 51.
Pseudo-Algorithm
- Get the Quote, Quote Item, Quote Item XA, Order Entry - Orders, Order Entry - Line Items, and Order Item XA business components.
The Quote business component is already positioned on the correct record, as the CreateOrder method is row-sensitive.
- Create a record in the Order Entry - Orders business component. Use Quote|Order FieldMap n to copy fields from the Quote business component to the Order Entry - Orders business component.
- For each record in the Quote Item business component, copy it to the Order Entry - Line Items business component using the Quote Item|Order Item FieldMap n field maps. To maintain hierarchical relationships, copy the parent record before copying its child records. Also copy records from the grandchild business component Quote Item XA to Order Item XA.
NOTE: As Quote Item and Order Entry - Line Items have hierarchies, you cannot simply loop through the records in Quote Item and copy them to Order Entry - Line Items. 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 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.- When doing step 3, for each record in the Quote Item business component:
If the record is a Siebel eTraining item, confirm the registration record in the eTraining business component.
- Set the CurrentOrderId profile attribute to the order that is created;
Set the Order Id output argument;
Clear the CurrentCheckOutQuoteId profile attribute;
If the Id of the quote record equals the CurrentQuoteId profile attribute, clear the CurrentQuoteId profile attribute by setting it = EMPTY_CART.
- Set the Error Message output argument if there is any error;
If Return Error Code = N, do not return an error;
Else return an error.
Bookshelf Home | Contents | Index | Search | PDF |
Siebel eSales Administration Guide Published: 18 April 2003 |