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

DiscardCart Method


DiscardCart discards the Current Quote and clears the CurrentQuoteId profile attribute. If the current quote type is Persistent Cart or Anonymous Quote, it also deletes the record from the Quote business component.

Preconditions for Calling the DiscardCart Method

  • This method is invoked in the following workflows:
    • eSales - Edit Quote Process
    • eSales - Order Quote Process
    • eSales - Modify Order Process
    • eSales - Reorder Process

      It is also invoked by the Empty Cart button in the Shopping Cart.

  • The field value of Quote Type for the current quote record can be Persistent Cart, Auction Quote, Quotation, or Anonymous Quote. When the quote type is Persistent Cart or Anonymous Quote, the quote record is deleted.

Arguments for the DiscardCart Method

The DiscardCart method has the arguments shown in Table 30.

Table 30. DiscardCart Arguments
Name
Type
Data Type
Optional
Comments

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 DiscardCart

  1. Get the Quote business component.
  2. Get the Id of the current record in the Quote business component:

    If Id <> CurrentQuoteId profile attribute, go to step 3;

    Else go to step 4.

  3. DiscardCart is being invoked from the eSales - Edit Quote Process,
    eSales - Order Quote Process, eSales - Modify Order Process, or eSales - Reorder Process workflow. The current record in the Quote business component is the quote being acted upon, and it is not the current quote in the Shopping Cart.

    Get another instance of the Catalog business object and the Quote business component, and position the second instance of the Quote business component on the quote record as indicated by the CurrentQuoteId profile attribute. As the first instance of the Quote business component is not being acted upon, from now on Quote means the second instance of the Quote business component.

  4. Set the CurrentQuoteId profile attribute = EMPTY_CART.
  5. Check the field value of [Quote Type]:

    If it is Persistent Cart or Anonymous Quote, then delete the record.

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