Siebel eSales Administration Guide > Shopping Service Methods Reference > Siebel eSales Workflow Methods >

SaveCartAsTemplate Method


SaveCartAsTemplate generates a template from a quote. The implementation is Template (see OrderTemplate Method) with some special considerations—for example, you cannot copy a Siebel Training or Siebel Events Management line item into a template.

Preconditions for Calling the SaveCartAsTemplate Method

Field maps are used to copy fields from the Quote to Quote Template, Quote Item to Quote Template Item, and Quote Item XA to Quote Template Item XA business components.

Sample field maps are shown in Table 27. See the Shopping Service business service user properties in Siebel Tools for more details.

Table 27. Sample Field Maps for the SaveCartAsTemplate Method
Name
Value

Quote|Quote Template FieldMap 100

Contact Id|Contact Id

Quote Item|Quote Template Item FieldMap 100

Product Id|Product Id

Quote Template Item XA|Quote Item XA FieldMap 100

Attribute Id|Attribute Id

Arguments for the SaveCartAsTemplate Method

The SaveCartAsTemplate method has the arguments shown in Table 28.

Table 28. SaveCartAsTemplate Arguments
Name
Type
Data Type
Optional
Comments

Quote Name

Input

String

Y

Saves the Shopping Cart as a template with this name.

Quote Name Field

Input

String

Y

Tells the Shopping Service which field is the quote name.

By default, it is Name if this input argument is not used.

Return Error Code

Input

String

Y

If equal to N, the method will not return errors.

When a method returns an error, the workflow stops. To avoid stopping the workflow, you can set this input to N. This way, the Shopping Service will not return an error but instead save the error message in the output argument Error Message. You can then handle the error message as you want.

Error Message

Output

String

Y

Stores error messages.

ReturnVal

Output

String

Y

Returns Success or Fail. Not used.

Pseudo-Algorithm for SaveCartAsTemplate

  1. 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.

  2. Check the Quote Name input argument. Query the Quote business component to see if there is an existing record with the same name.

    If there is, go to step 3;

    Else go to step 4.

    As Quote Template is a special type of Quote, the Quote business component can be used to search both Quote and Quote Template.

  3. Set Error Message to indicate there is a duplicate name. Check the Return Error Code input argument.

    If Return Error Code = N, do not return an error;

    Else return an error.

  4. Create a record in the Quote Template business component. Use the Quote to Quote Template field maps to copy fields from the record in the Quote business component to the record in the Quote Template business component. Set the Name to the Quote Name input argument.
  5. Copy each record in the Quote Item business component to the Quote Template Item business component.

    NOTE:  As in the OrderTemplate method, make sure the hierarchical relationship is copied correctly by copying each parent record before its child records. Also, copy the child records from Quote Item XA to Quote Template XA.

Siebel eSales Administration Guide Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.