9Shopping Service Methods Reference

Shopping Service Methods Reference

This chapter describes the Shopping Service business service, and it contains the following sections:

About the Shopping Service Business Service

In Siebel eSales, the Shopping Cart and order management use workflows for various actions, such as checking out, editing quotes, modifying orders, and so on.

The Shopping Service business service provides methods that can be invoked in the workflows. In addition, in Siebel 7 the Add to Cart feature has been moved from the Quote business component to the Shopping Service business service. This is because business services can be accessed more universally than business components.

Therefore, the Shopping Service can support other features such as Add to Favorites, Quick Add, and Save Cart As Template. It is also easier for other applications, such as Siebel Partner Relationship Management, to integrate with Siebel eSales order management.

Siebel eSales User Action Methods

These methods are invoked by actions taken by users of the Siebel eSales Web site, such as clicking Add to Cart. They are as follows:

    AddItem Method

    This method is similar to AddToCart Method.

    The only difference is that AddItem can be used to AddItems to the shopping cart of to favorites, while AddToCart can only be used to add items to the shopping cart

      AddToCart Method

      This method is invoked to add an item to the Shopping Cart. It checks the input argument Action. Depending on the value of the Action field, the Shopping Cart takes different actions, as described in the following table.

      Action Method Invoked

      AddToCart

      DefaultAddToCart

      Customize

      DefaultAddToCart

      QuickAdd

      QuickAdd

      AddTrainingItem

      AddTrainingItem

      AddEventItem

      AddTrainingItem

      AddEventSessionItem

      AddTrainingItem

      What the AddToCart method does is to create one or more records (for complex products) in the Quote Item business component in the current quote record (indicated by CurrentQuoteId) in the Quote business component.

      If the product has extended attributes, it also copies the extended attribute values from the Product XA VBC business component to the Quote Item XA business component. The extended attributes for a product are in the XA Attribute Value business component. End users can select values for each modifiable attribute; these selections are stored in the Product XA VBC business component.

      For example, if you add a product with four attributes to the Shopping Cart, you create one record in the Quote Item business component and four records in the Quote Item XA business component. The mapping is as follows:

      • Product to Quote Item

      • Product XA VBC to Quote Item XA

        Preconditions for Calling the AddToCart Method

        • Where AddToCart can be called. This method can be called from either an applet or a business component. In each case, the caller function needs to call the SetBusComp method to set the current business component to the Shopping Service instance.

          The Shopping Service instance needs to use the current business component to get the current business object and all the context information. Therefore, you cannot invoke this method from an applet that does not have a business component.

        • Quote record. The Shopping Cart is just a quote record whose row ID equals the CurrentQuoteId profile attribute. The Quote Type field value for this current quote record can be Quotation, Persistent Cart, or Anonymous Quote.

          • If it is Quotation, then the current quote is a normal quote.

          • If it is Persistent Cart, it means this application supports the Persistent Shopping Cart and this quote is the Persistent Shopping Cart for that user.

          • If it is Anonymous Quote, it means this application allows anonymous users to add items to the Shopping Cart and this user is an anonymous user.

        • Price List Id, Promotion Id, and Campaign Id fields. The current quote record has a Price List Id field, a Promotion Id field, and a Campaign Id field. The field value for Price List Id cannot be empty. The field values for Promotion Id and Campaign Id can be empty or not.

          There are also three corresponding profile attributes—PromotionId, CampaignId, and PriceListId. These can be set by Siebel eMarketing when a user clicks the hyperlink on a Web offer. Therefore, the field values for Price List Id, Campaign Id, and Promotion Id in the current quote record can be different from the values in the PriceListId, CampaignId, and PromotionId profile attributes. When users add items to the Shopping Cart, these three field values in the current quote record are set to the value from the corresponding profile attributes.

        • Internal Product by Price List Optional business component. This is the underlying product business component for AddToCart, QuickAdd, and Customize.

          All other business components use this business component as the proxy business component for AddToCart. This is because only this business component has extended attribute child business components such as Product XA VBC and XA Attribute Value. In addition, it is used in Attribute Adjustments.

          The user properties for the Internal Product by Price List Optional business component are listed in the following table.

          Name Value Explanation

          Field:Base Price

          Catalog Price

          The C++ code for the Shopping Service and Attribute Adjustments refers to certain fields. Instead of hard-coding the field name in C++, this user property is used for mapping between the field to which the C++ code refers and the actual field name in the business component.

          For example, this user property indicates that the Base Price to which the C++ code refers is called Catalog Price in the Internal Product by the Price List Optional business component.

          This way, Base Price in the C++ code can be mapped to different fields in different business components.

          Field:Catalog Price

          Catalog Price

          Similar to Field:Base Price. Used in Attribute Adjustments.

          Field:Reference Price

          Reference Price

          Similar to Field:Base Price. Used in Attribute Adjustments.

          Field:Price Book Id

          Price Book Id

          Similar to Field:Base Price. Used in Attribute Adjustments.

          Field:Promotional Price

          Promotional Price

          Similar to Field:Base Price. Used in Attribute Adjustments.

          Field:Quantity

          Quantity

          Similar to Field:Base Price. Refers to the Quantity field. Used in Attribute Adjustments and in the Shopping Service.

          Field:Your Price

          Your Price

          Similar to Field:Base Price. Used in Attribute Adjustments.

          Product XA

          Product XA VBC

          Indicates that the extended attribute to use is Product XA VBC.

          SetPriceListSearch

          Y

          Indicates that the [Price List Id] = GetProfileAttr(“PriceListId”) search specification should be applied to the business component.

          If used, only products that are on the current price list are visible in Siebel eSales.

          Use Promotional Price

          Y

          Used in Attribute Adjustments.

          When this is Y, the Base Price equals the Promotional Price if the Promotional Price field is not empty. Otherwise, the Base Price equals the Reference Price.

        • AddToCartAutoQuote input argument. When there is no current quote as specified by CurrentQuoteId, AddToCart decides whether to create a new quote automatically based on certain conditions:

          • AddToCart checks the AddToCartAutoQuote input argument. If its value is Y or TRUE, AddToCart automatically creates a new quote. If its value is N or FALSE, AddToCart does not automatically create a new quote.

          • If the AddToCartAutoQuote input argument is empty, AddToCart checks the AddToCartAutoQuote server component parameter (See the following table.)

        • AddToCartGotoView input argument. The calling action can also specify the next view to which to navigate after finishing the AddToCart method. This is done through the AddToCartGotoView input argument:

          • If this input is not empty, the application navigates to the specified view.

          • If this input is empty, the Shopping Service looks for the AddToCartGotoView server component parameter as defined for InfraShoppingService in the repository (See the following table.)

        • Server component parameters. The server component parameters used by the Shopping Service business service are listed in the following table. You can change these parameters by navigating to Server Administration > Components > Component Parameters.

        Name Default Value Explanation

        AddToCartAutoQuote

        TRUE

        The value can be TRUE or FALSE.

        If it is TRUE, AddToCart automatically creates a new quote if there is no current quote.

        AddToCartGotoView

        NONE

        The value can be NONE or a specific view name.

        If it is a specific view name, the application navigates the user to that view after finishing the AddToCart method.

        AnonymousQuote

        TRUE

        The value can be TRUE or FALSE.

        If it is TRUE, AddToCart allows anonymous users to add items to the Shopping Cart, and it creates quotes with quote type Anonymous Quote.

        If it is FALSE, AddToCart does not allow anonymous users to add items to the Shopping Cart.

        AutoQuoteDefaultOwner

        TRUE

        The value can be TRUE or FALSE.

        If it is TRUE, when AddToCart automatically creates a new quote, it automatically fills in the Contact Id and Account Id fields with the current user's login ID and account ID.

        PersistentShoppingCart

        FALSE

        The value can be TRUE or FALSE.

        If it is TRUE, the application supports the Persistent Shopping Cart. The quote created by AddToCart will have type Persistent Cart.

        When the user logs in to the application, the run-time event triggers the eSales Web Login Action Set. The SetShoppingCart method in that action set loads the quote with type Persistent Cart for that user.

        ProductDetailView

        Product Detail - Features View (eSales)

        Specifies the view name for the Product Detail view.

        ShoppingCartView

        NONE

        Specifies the view for the Shopping Cart.

        • Business object must include all necessary business components. The list of business components that must be in the business object calling the AddToCart method is shown in the following table, using the Catalog business object as an example.

          Business Component Link Comment

          Internal Product by Price List Optional

          Underlying business component for AddToCart, QuickAdd, and Customize.

          All other business components by default use this business component as the AddToCart Proxy Buscomp.

          Internal Product by Price List Optional 2

          Catalog Category/Internal Product by Price List Optional 2

          Used in the Product list applet for AddToCart.

          This business component uses Internal Product by Price List Optional as the AddToCart Proxy Buscomp.

          XA Attribute Value

          Internal Product by Price List Optional/XA Attribute Value

          Needed for extended attributes.

          Product XA VBC

          Needed for extended attributes.

          Product XA VBC Form

          Internal Product by Price List Optional/Product XA VBC Form

          Needed for extended attributes.

          Quote

          Quote Item

          Quote/Quote Item

          Quote Item XA

          Training Class Registration

          Needed for AddTrainingItem.

          eEvents Event Attendee

          Needed for AddTrainingItem.

          eEvents Session Attendee

          Needed for AddTrainingItem.

          Favorite List

          Needed for AddToFavoriteList.

          Favorite List Item

          Favorite List/Favorite List Item

          Needed for AddToFavoriteList.

          Arguments for the AddToCart Method

          The arguments for the AddToCart method are shown in the following table.

          Name Type Data Type Optional Comments

          Action

          Input

          String

          Y

          Specifies the action to take.

          Action can take the following values:

          • AddToCart

          • Customize
          • QuickAdd
          • AddTrainingItem
          • AddEventItem
          • AddEventSessionItem

          AddToCart Quote Fields

          Input

          String

          Y

          This argument is used to pass the field values set in the Quote business component. It is a concatenated string of Quote business component field name/value pairs.

          The input value is in the following format:

          fieldName1=fieldValue1|fieldName2=fieldVal
          ue2|...
          

          For example, if you set the Description and Discount Reason fields, then the input user property value is as follows:

          Description=Returning customer|Discount 
          Reason=Gold member of the loyalty program
          
          Note: This only impacts new quotes, and not existing quotes.

          AddToCart deconstructs this string and sets the corresponding fields in the Quote business component.

          AddToCart Quote Item Fields

          Inputs

          String

          Y

          This argument is used to pass the field values set in the Quote Item business component.

          The input value is in the following format:

          fieldName1=fieldValue1|fieldName2=fieldVal
          ue2|...
          

          For example, if you want to set the Adjust List Price, Base Price, and Quantity Requested fields, then the input user property value is as follows:

          Base Price=500|Adjusted List 
          Price=450|Quantity Requested=3
          
          Note: If you set a field that triggers a reprice, such as Quantity Requested, then that field must be set at the end of the string.

          AddToCart AutoQuote

          Input

          String

          Y

          Used to decide whether to create a new quote automatically if there is no current quote.

          If empty, AddToCart looks for the server component parameter with the same name.

          AddToCart GotoView

          Input

          String

          Y

          Used to decide to which view to navigate after adding an item has been completed.

          If empty, AddToCart looks for the server component parameter with the same name.

          Source Currency Code

          Input

          String

          Y

          Specifies the currency code for the price.

          If not empty and not equal to the currency code in the quote, AddToCart does the currency conversion and sets the converted Price field in the quote item.

          Quote Id

          Output

          String

          Y

          Returns the quote ID for the current quote.

          Quote Item Id

          Output

          String

          Y

          Returns the quote item ID.

          ReturnVal

          Output

          String

          Y

          Returns Success or Fail. Not used.

            Pseudo-Algorithm for AddToCart

            Follow these steps when using a pseudo-algorithm for AddToCart:

            1. Call CanAddToCart method to check whether or not a user can add items to the Shopping Cart:

              If the CurrentQuoteId profile attribute is not empty and is a valid quote ID, return TRUE;

              else if the AddToCartAutoQuote input argument is TRUE, return TRUE;

              else if the AddToCartAutoQuote server component parameter is TRUE, return TRUE;

              else return FALSE.

            2. Check the Action input argument:

              If Action = AddTrainingItem or AddEventItem or AddEventSessionItem, call the AddTrainingItem method;

              Else if Action = QuickAdd, call the QuickAdd method;

              Else if Action = AddToCart or Customize:

              Call the DefaultAddToCart method.

            3. Call the PostAddToCart method.

              Pseudo-Algorithm for DefaultAddToCart

              Follow these steps when using a pseudo-algorithm for DefaultAddToCart:

              1. Get the Quote, Quote Item, and Quote Item XA business components.

              2. Call AddHeader to make sure there is a current quote for adding an item, What AddHeader does is to make sure there is a current quote, if there is not a current one. AddHeader will create a new quote and set the CurrentQuoteID profile attribute value to the Row ID of the newly created quote record.

              3. Create a new record in the Quote Item business component.

              4. Populate that line item with information from Product the user has selected.

              5. Check the Action input argument:

                If Action = Customize, then call ReConfigCxProd to launch the customizable product run-time view.

              6. End.

                Pseudo-Algorithm for PostAddToCart

                Follow these steps when using a pseudo-algorithm for PostAddToCart:

                1. Check the Action input argument:

                  If Action = Customize, End;

                  Else go to step 2.

                2. Check the AddToCartGotoView input argument:

                  If not empty, then navigate to that view and End;

                  Else go to step 3.

                3. Check the AddToCartGotoView server component parameter:

                  If not empty and <> NONE, then navigate to that view and End;

                  Else End.

                  AddToFavoriteList Method

                  This method is invoked to add items to the Favorites list.

                    Preconditions for Calling the AddToFavoriteList Method

                    When calling this method, you need to make sure the business components that are shown in the following table are in the business object, using the Catalog business object as an example.

                    Business Component Link Comment

                    Internal Product by Price List Optional

                    Product business component used in Siebel eSales.

                    Internal Product by Price List Optional 2

                    Catalog Category/Internal Product by Price List Optional 2

                    Business component used in product list applet.

                    Favorite List

                    Favorite List business component.

                    Favorite List Item

                    Favorite List/Favorite List Item

                    Favorite List Item business component.

                      Arguments for the AddToFavoriteList Method

                      The arguments for the AddToFavoriteList method are shown in the following table.

                      Name Type Data Type Optional Comments

                      Action

                      Input

                      String

                      Y

                      Equals AddToFavoriteList.

                      Product Id

                      Input

                      String

                      Y

                      If this input is not empty, add the product specified by this ID to the Favorites list.

                      Otherwise, assume the current record in the current business component is the item to add to the Favorites list.

                      GotoView

                      Input

                      String

                      Y

                      If this input is not empty, AddToFavoriteList navigates to this view after completing the AddToFavoriteList action.

                      ReturnVal

                      Output

                      String

                      Y

                      Returns Success or Fail. Not used.

                        Pseudo-Algorithm for AddToFavoriteList

                        1. If the user is an anonymous user, End.

                        2. Get the Favorite List and Favorite List Item business components.

                        3. Query the Favorite List business component with the search specification [Person Id] = LoginId;

                          If there is a existing record, go to step 4;

                          Else create a new record and set [Person Id] to current login ID.

                        4. Query the Favorite List Item business component with the search specification [Product Id] = input product ID;

                          If there is an existing record, go to step 5;

                          Else create a new record and set [Product Id] to input product ID.

                        5. If GotoView input argument is not empty, navigate to the specified view and End;

                          Else check the Favorite List View user property in the Shopping Service business service:

                          If this value is empty, End;

                          Else navigate to this view and End.

                          SetShoppingCart Method

                          This method is used in run-time event action sets to support the Persistent Shopping Cart and anonymous users adding items to the Shopping Cart.

                          SetShoppingCart is used in the eSales WebLogin Action Set. This action set is associated with the WebLogin run-time event for the Siebel eSales application object. When a Siebel eSales user logs in, the WebLogin run-time event is triggered. This in turn triggers the eSales Web Login Action Set and executes the SetShoppingCart method.

                          The method checks if there is already a current quote in the session as indicated by the CurrentQuoteId profile attribute:

                          • If this profile attribute is empty, it determines if there is any quote of type Persistent Cart associated with the user. If there is one, it loads that quote and sets the CurrentQuoteId profile attribute to that quote ID.

                          • If CurrentQuoteId is already set, it checks if the quote type is Anonymous Quote and converts it to Persistent Cart if it is.

                            Preconditions for Calling the SetShoppingCart Method

                            • The following server component parameters must be set to TRUE:

                              • PersistentShoppingCart

                              • AnonymousQuote

                            • To use this method, you need to create an action set with an action that invokes this method. For example, the actions in the eSales Web Login Action Set are shown in the following table.

                            Action Business Service InvokeMethod

                            SetPriceList

                            Pricing Manager

                            SetPriceList

                            SetShoppingCart

                            Shopping Service

                            SetShoppingCart

                            After that, you need to associate this action set with the WebLogin run-time event for the application. The following applications use the eSales WebLogin Action Set:

                            • Siebel Partner Relationship Management

                            • Siebel eCustomer

                            • Siebel eSales

                              Arguments for the SetShoppingCart Method

                              None.

                                Pseudo-Algorithm for SetShoppingCart

                                1. If the Is Anonymous profile attribute = TRUE, End.

                                2. Check the CurrentQuoteId profile attribute:

                                  If empty or = EMPTY_CART, there is no current quote. Go to step 3;

                                  Else go to step 4.

                                3. Get the Catalog business object and the Quote, Quote Item, and Quote Item XA business components. Query the Quote business component with the search specification [Contact Id] = LoginId () AND [Quote Type] = LookupValue ('QUOTE_TYPE', 'Persistent Cart') to find the quote record of type Persistent Cart for that user. One or zero records will be returned.

                                  If one record is returned, the user has a Persistent Cart. Set the CurrentQuoteId profile attribute to the record ID, then go to step 8.

                                4. Get the Catalog business object and the Quote, Quote Item, and Quote Item XA business components. Query the Quote business component with the search specification [Id] = GetProfileAttr(“CurrentQuoteId”) to get the current quote. Check the Quote Type field value:

                                  If [Quote Type]= LookupValue ('QUOTE_TYPE', 'Anonymous Quote'), the current quote is an anonymous user’s Shopping Cart. Go to step 5;

                                  Else, go to step 6.

                                5. Before converting Anonymous Quote to Persistent Cart, it is necessary to check if the user already has a Persistent Shopping Cart. Get a second instance of the Catalog business object and the Quote, Quote Item, and Quote Item XA business components. Query the second instance of the Quote business component with the search specification [Contact Id] = LoginId () AND [Quote Type] = LookupValue ('QUOTE_TYPE', 'Persistent Cart'). It will return one or zero records.

                                  If it returns no records, go to step 6;

                                  If it returns one record, it is necessary to resolve the conflict between the anonymous quote and an existing persistent Shopping Cart. Go to step 7.

                                6. Convert Anonymous Quote to Persistent Cart:

                                  Set [Account Id] to the account ID of the current user;

                                  Set [Contact Id] to the login ID of the current user;

                                  Set [Quote Type] to LookupValue ('QUOTE_TYPE', 'Persistent Cart');

                                  Set [Price List Id] to the current price list ID;

                                  End.

                                7. There are two quote records: the quote record in the first Quote instance is the Anonymous Quote; the record in the second Quote instance is the previous Persistent Shopping Cart. Save the previous Persistent Shopping Cart as a quote with a name.

                                8. If the price list in the current quote is different from the current price list, set [Price List Id] to the current price list ID in the system.

                                  SetApplicationName Method

                                  This method sets the ApplicationName profile attribute, which is used in workflow branching conditions and in Siebel Personalization to hide or show an applet in a view for various applications.

                                  SetApplicationName is used in the eSales WebSessionStart Action Set. This action set is associated with the WebSessionStart run-time event for the Siebel eSales application object. When a Web session starts (usually the first time a user visits the Web site), this event is triggered. This in turn triggers the eSales Web Session Start Action Set, executing the SetApplicationName method. The ApplicationName profile attribute is set to the name for the application that is running.

                                    Preconditions for Calling the SetApplicationName Method

                                    To use this method, you need to create an action set and invoke this method from an action in the action set, as shown for the eSales WebSessionStart Action Set in the following table.

                                    Action Business Service InvokeMethod

                                    SetApplicationName

                                    Shopping Service

                                    SetApplicationName

                                    The following applications use the eSales WebSessionStart Action Set:

                                    • Siebel Call Center

                                    • Siebel Partner Relationship Management

                                    • Siebel eCustomer

                                    • Siebel eEvents Management

                                    • Siebel eSales

                                    • Siebel Self Service

                                    • Siebel Marketing

                                      Arguments for the SetApplicationName Method

                                      None.

                                        Pseudo-Algorithm for SetApplicationName

                                        Get the application name and set the ApplicationName profile attribute.

                                          SetShoppingCartInfoChanged Method

                                          This method monitors any change in the number of items in the shopping cart. If an item in the shopping cart is added or deleted, then this method assigns the value Y to the ShoppingCartInfoChanged profile attribute, regardless of the previous value.

                                            Preconditions for Calling the SetShoppingCartInfoChanged Method

                                            This method is called while adding line items to, or, deleting line items from the shopping cart, so that the current value of the item count in the cart is shown.

                                              Arguments for the SetShoppingCartInfoChanged Method

                                              There are no arguments for the SetShoppingCartInfoChanged Method.

                                                Pseudo-Algorithm for SetShoppingCartInfoChanged

                                                Assigns the ShoppingCartInfoChanged profile attribute to Y.

                                                  GetCartInfo Method

                                                  This method retrieves the number of root products present in the cart, and is called when items are added to or deleted from the cart.

                                                    Preconditions for Calling the GetCartInfo Method

                                                    This method is invoked to obtain the number of current items in the cart. The active quote must exist and the CurrentQuoteId profile attribute must be populated, otherwise the number of current items in the cart returns as 0. The Quote Item business component and the Quote business object are passed to this method as an optional input argument. In the event that these items are not passed to the method, then by default the GetCartInfo method takes Quote as a business object and SS Quote Item as a business component.

                                                      Arguments for the GetCartInfo Method

                                                      The arguments for the GetCartInfo method are shown in the following table.

                                                      Name Type Data Type Optional Comments

                                                      Count

                                                      Output

                                                      String

                                                      N

                                                      Returns count of root items present in the current cart.

                                                      SSBusComp

                                                      Input

                                                      String

                                                      Y

                                                      Specifies the business component to be queried.

                                                      SSBusObj

                                                      Input

                                                      String

                                                      Y

                                                      Specifies the business object containing the business component to be queried.

                                                        Pseudo-Algorithm for GetCartInfo

                                                        • If the SSBusComp argument is not passed, this method reads the value of CurrentQuoteId profile attribute to obtain the current quote ID and to query the SS Quote Item business component. With the additional search specification, this retrieves the number of root line items present in the quote.

                                                        • Sets the record count as output of the method. If the additional search specification has a value defined as part of the Cart Count Search Spec business service user property, then this value overwrites the Root Quote Items search specification, and is then used, along with Quote Id, to get the line item for the current quote.

                                                          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 the following tables.

                                                            Name Value

                                                            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

                                                            Name Value

                                                            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 arguments for the OrderTemplate method are shown in the following table.

                                                              Name Type Data Type Optional Comments

                                                              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

                                                                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. Call the AddHeader method to make sure there is a Shopping Cart.

                                                                3. 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:

                                                                  Siebel eSales Workflow Methods

                                                                  The following methods are invoked by Oracle’s Siebel eSales workflows:

                                                                  Note: Some of the methods in this section have values pertaining to auctions. Auctions are not part of the current Siebel Business Application’s functionality. These values are included for backward compatibility only.

                                                                    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 the following table. For more information, see the Shopping Service business service user properties in Siebel Tools.

                                                                      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 arguments for the SaveCartAsTemplate method are shown in the following table.

                                                                        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.

                                                                            SaveCartAsQuote Method

                                                                            SaveCartAsQuote saves the Shopping Cart (current quote record) as a quote.

                                                                              Preconditions for Calling the SaveCartAsQuote Method

                                                                              • This method is invoked in the following workflows:

                                                                                • eSales - Save Cart Process

                                                                                • eSales - Edit Quote Process

                                                                                • eSales - Order Quote Process

                                                                                • eSales - Modify Order Process

                                                                                • eSales - Reorder Process

                                                                              • The field value of Quote Type for the current quote record can be Persistent Cart, Auction Quote, Quotation, or Anonymous Quote. Anonymous users cannot call SaveCartAsQuote, so only the first three quote types can be saved.

                                                                                If the quote type is Persistent Cart, SaveCartAsQuote changes the type to Quotation. Otherwise, it does not change the quote type.

                                                                                Arguments for the SaveCartAsQuote Method

                                                                                The arguments for the SaveCartAsQuote method are shown in the following table.

                                                                                Name Type Data Type Optional Comments

                                                                                Quote Name

                                                                                Input

                                                                                String

                                                                                Y

                                                                                Saves the Shopping Cart as a quote 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 SaveCartAsQuote

                                                                                  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. SaveCartAsQuote 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. 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 5;

                                                                                    Else go to step 6.

                                                                                  5. Set the Error Message output argument to indicate that 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.

                                                                                  6. Set the Name field with the Quote Name input argument. Check the field value of [Quote Type]:

                                                                                    If it is Persistent Cart, then change it to Quotation.

                                                                                    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 arguments for the DiscardCart method are shown in the following table.

                                                                                        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.

                                                                                            OrderQuote Method

                                                                                            OrderQuote is called in the eSales - Checkout Process workflow. It checks if there are any line items in the Shopping Cart. It returns an error if the Shopping Cart does not have any line items. It also sets the CurrentCheckOutQuoteId profile attribute.

                                                                                              Preconditions for Calling the OrderQuote Method

                                                                                              This method is invoked in the eSales - Checkout Process workflow. The sequence called is OrderQuote, then ValidQuote (see ValidQuote Method), and then RemoveInvalidItems (see RemoveInvalidItems Method).

                                                                                                Arguments for the OrderQuote Method

                                                                                                The arguments for the OrderQuote method are shown in the following table.

                                                                                                Table

                                                                                                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.

                                                                                                Quote Id

                                                                                                Input

                                                                                                String

                                                                                                Y

                                                                                                Not used.

                                                                                                ReturnVal

                                                                                                Output

                                                                                                String

                                                                                                Y

                                                                                                Returns Success or Fail. Not used.

                                                                                                  Pseudo-Algorithm for Order Quote

                                                                                                  1. Get the Quote and Quote Item business components.

                                                                                                  2. If there are any records in the Quote Item business component, go to step 3;

                                                                                                    Else go to step 4.

                                                                                                  3. Set the CurrentCheckOutQuoteId profile attribute.

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

                                                                                                    ValidQuote Method

                                                                                                    ValidQuote is called in the eSales - Checkout Process workflow to validate the line items in the Shopping Cart. Valid line items are those that do not have an empty Base Price field in the Quote Item business component.

                                                                                                    ValidQuote sets the Invalid output argument to Y if there are any line items that are invalid, and also sets Invalid Flag field for each line item that is invalid. The Invalid Flag field is a virtual field in the Quote Item business component that is persistent in the session.

                                                                                                      Preconditions for Calling the ValidQuote Method

                                                                                                      • This method is invoked in the eSales - Checkout Process workflow. The sequence called is OrderQuote (see OrderQuote Method), then ValidQuote, and then RemoveInvalidItems (see RemoveInvalidItems Method).

                                                                                                      • This method checks only the Base Price field in the Quote Item business component. If this field is empty for a record, then the record is invalid. You can override this method to do your own validity checking.

                                                                                                        Arguments for the ValidQuote Method

                                                                                                        The arguments for the ValidQuote method are shown in the following table.

                                                                                                        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.

                                                                                                        Invalid

                                                                                                        Output

                                                                                                        String

                                                                                                        Y

                                                                                                        Returns Y if there are any invalid items in the Shopping Cart. Else returns N.

                                                                                                        Quote Id

                                                                                                        Input

                                                                                                        String

                                                                                                        Y

                                                                                                        Not used.

                                                                                                        ReturnVal

                                                                                                        Output

                                                                                                        String

                                                                                                        Y

                                                                                                        Returns Success or Fail. Not used.

                                                                                                          Pseudo-Algorithm for ValidQuote

                                                                                                          1. Get the Quote and Quote Item business component. Create a variable invalidFlag=N.

                                                                                                          2. For each record in the Quote Item business component, check the Base Price field:

                                                                                                            If this field is empty, set invalidFlag = Y and set the Invalid Flag field = Y for that record.

                                                                                                          3. Set the Invalid output argument = invalidFlag.

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

                                                                                                            RemoveInvalidItems Method

                                                                                                            RemoveInvalidItems is called in Check Out workflow. It deletes each record in the Quote Item business component whose Invalid Flag is Y.

                                                                                                              Preconditions for Calling the RemoveInvalidItems Method

                                                                                                              • This method is invoked in the eSales - Checkout Process workflow. The sequence called is OrderQuote (see OrderQuote Method), then ValidQuote (see ValidQuote Method), and then RemoveInvalidItems.

                                                                                                              • This method checks only the Base Price field in the Quote Item business component. If this field is empty for a record, then the record is invalid. You can override this method to do your own validity checking.

                                                                                                                Arguments for the RemoveInvalidItems Method

                                                                                                                The arguments for the RemoveInvalidItems method are shown in the following table.

                                                                                                                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.

                                                                                                                Invalid

                                                                                                                Input

                                                                                                                String

                                                                                                                Y

                                                                                                                If equal to N, do nothing.

                                                                                                                Else loop through each line item to delete invalid items.

                                                                                                                Quote Id

                                                                                                                Input

                                                                                                                String

                                                                                                                Y

                                                                                                                Not used.

                                                                                                                ReturnVal

                                                                                                                Output

                                                                                                                String

                                                                                                                Y

                                                                                                                Returns Success or Fail. Not used.

                                                                                                                  Pseudo-Algorithm for RemoveInvalidItems

                                                                                                                  1. Get the Quote and Quote Item business components.

                                                                                                                  2. Check the Invalid input argument:

                                                                                                                    If Invalid = N, go to step 4.

                                                                                                                  3. For each record in the Quote Item business component, check the Invalid Flag field:

                                                                                                                    If the field value is Y, delete the record.

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

                                                                                                                    CreateOrder Method

                                                                                                                    CreateOrder method creates an order from the current quote. It creates a record in the Order Entry - Orders business component. Also, 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.

                                                                                                                      Preconditions for Calling the CreateOrder Method

                                                                                                                      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.

                                                                                                                      Sample field maps are shown in the following table. For more information, see the Shopping Service business service user properties in Siebel Tools.

                                                                                                                      Table

                                                                                                                      Name Value

                                                                                                                      Quote|Order FieldMap 100

                                                                                                                      Contact Id|Contact Id

                                                                                                                      Quote Item|Order Item FieldMap 100

                                                                                                                      Class Registration Id|Class Registration Id

                                                                                                                      Quote Item XA|Order Item XA FieldMap 101

                                                                                                                      Name|Name

                                                                                                                        Arguments for the CreateOrder Method

                                                                                                                        The arguments for the CreateOrder method are shown in the following table.

                                                                                                                        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.

                                                                                                                        Quote Id

                                                                                                                        Input

                                                                                                                        String

                                                                                                                        Y

                                                                                                                        Not used.

                                                                                                                        Order Id

                                                                                                                        Output

                                                                                                                        String

                                                                                                                        Y

                                                                                                                        ID of the order record that is created.

                                                                                                                        ReturnVal

                                                                                                                        Output

                                                                                                                        String

                                                                                                                        Y

                                                                                                                        Returns Success or Fail. Not used.

                                                                                                                          Pseudo-Algorithm for CreateOrder

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

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

                                                                                                                            Note: Only fields that have been fetched from the database will be copied over. Fields fetched are fields that either have the property Force Active set to True or that are displayed in the applet or that have been activated in scripting with method BusComp.ActivateField(FieldName).
                                                                                                                          3. 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.
                                                                                                                          4. When doing step 3, for each record in the Quote Item business component:

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

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

                                                                                                                            Reorder Method

                                                                                                                            Reorder is the reverse of CreateOrder. It creates a quote from an existing order.

                                                                                                                              Preconditions for Calling the Reorder Method

                                                                                                                              • Field maps are used to copy fields from the Order to Quote and Order Entry - Line Items to Quote Item business components, in the reverse of the CreateOrder method. Field maps are used to copy records from the Order Item XA to the Quote Item XA business component.

                                                                                                                                Sample field maps are shown in the following table. For more information, see the Shopping Service business service user properties in Siebel Tools.

                                                                                                                                Name Value

                                                                                                                                Quote|Order FieldMap 100

                                                                                                                                Contact Id|Contact Id

                                                                                                                                Quote Item|Order Item FieldMap 100

                                                                                                                                Class Registration Id| Class Registration Id

                                                                                                                                Quote Template Item XA|Quote Item XA FieldMap 100

                                                                                                                                Attribute Id|Attribute Id

                                                                                                                                Arguments for the Reorder Method

                                                                                                                                The arguments for the Reorder method are shown in the following table.

                                                                                                                                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.

                                                                                                                                Quote Id

                                                                                                                                Output

                                                                                                                                String

                                                                                                                                Y

                                                                                                                                ID of the quote that is created.

                                                                                                                                Order Id

                                                                                                                                Output

                                                                                                                                String

                                                                                                                                Y

                                                                                                                                Not used.

                                                                                                                                ReturnVal

                                                                                                                                Output

                                                                                                                                String

                                                                                                                                Y

                                                                                                                                Returns Success or Fail. Not used.

                                                                                                                                  Pseudo-Algorithm for Reorder

                                                                                                                                  1. Get the Order Entry - Orders, Order Entry - Line Items, and Order Item XA business components. Get an instance of the Catalog business object and of the Quote, Quote Item, and Quote Item XA business components from this Catalog business object instance.

                                                                                                                                    The Order Entry - Orders business component is already positioned on the correct record, as the Reorder method is row-sensitive.

                                                                                                                                  2. Create a record in the Quote business component. Use Quote|Order FieldMap n to copy fields from the Order Entry - Orders business component to Quote.

                                                                                                                                  3. For each record in the Order Entry - Line Items business component, copy it to the Quote Item business component using 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 Order Item XA to Quote Item XA.

                                                                                                                                    Note:
                                                                                                                                  4. When doing step 3, for each record in the Order Entry - Line Items business component:

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

                                                                                                                                    Get ShoppingCartStatus Method

                                                                                                                                    GetShoppingCartStatus is called to get the status of the Shopping Cart (current quote as indicated by the CurrentQuoteId profile attribute). It returns three output arguments—Status, Quote Type, and Count.

                                                                                                                                      Preconditions for Calling the GetShoppingCartStatus Method

                                                                                                                                      None.

                                                                                                                                        Arguments for the GetShoppingCartStatus Method

                                                                                                                                        The arguments for the GetShoppingCartStatus method are shown in the following table.

                                                                                                                                        Name Type Data Type Optional Comments

                                                                                                                                        Quote Type

                                                                                                                                        Output

                                                                                                                                        String

                                                                                                                                        Y

                                                                                                                                        Type of the current quote record.

                                                                                                                                        If Persistent Cart, check Status and Count to determine whether the quote is empty or not.

                                                                                                                                        If not Persistent Cart, Status will always be Empty and Count will always be 0 even though the current quote record might contain line items.

                                                                                                                                        Status

                                                                                                                                        Output

                                                                                                                                        String

                                                                                                                                        Y

                                                                                                                                        Can be Empty or Not Empty.

                                                                                                                                        Count

                                                                                                                                        Output

                                                                                                                                        String

                                                                                                                                        Y

                                                                                                                                        Number of line items in the Shopping Cart.

                                                                                                                                        Quote Id

                                                                                                                                        Input

                                                                                                                                        String

                                                                                                                                        Y

                                                                                                                                        Not used.

                                                                                                                                        ReturnVal

                                                                                                                                        Output

                                                                                                                                        String

                                                                                                                                        Y

                                                                                                                                        Returns Success or Fail. Not used.

                                                                                                                                          Pseudo-Algorithm for GetShoppingCartStatus

                                                                                                                                          1. If CurrentQuoteId is empty or equals to EMPTY_CART:

                                                                                                                                            Set Quote Type = Quotation;

                                                                                                                                            Set Status = Empty;

                                                                                                                                            Set Count = 0;

                                                                                                                                            End.

                                                                                                                                          2. If Quote Type is not Persistent Cart:

                                                                                                                                            Set Quote Type accordingly;

                                                                                                                                            Set Status = Empty;

                                                                                                                                            Set Count = 0;

                                                                                                                                            End.

                                                                                                                                          3. Loop through the Quote Item business component. Set Status and Count accordingly.

                                                                                                                                            MoveToCart Method

                                                                                                                                            MoveToCart moves a quote record into the Shopping Cart. By doing this, it sets the CurrentQuoteId profile attribute to the quote record ID. It also sets the Price List Id field value of this quote to the current price list for the session as indicated by the PriceListId profile attribute, for users associated with an account that has a default price list, and by DefaultPriceListId for users who are not associated with such an account. This triggers a reprice if the price list for this quote has been changed.

                                                                                                                                            In addition, if the field value of Quote Type is not Auction Quote, it changes the quote type to Persistent Cart if the application supports persistent Shopping Carts. For applications that do not support Shopping Carts, the Shopping Service does not change the quote type.

                                                                                                                                              Preconditions for Calling the MoveToCart Method

                                                                                                                                              • This method is invoked in the following workflows:

                                                                                                                                                • eSales - Edit Quote Process

                                                                                                                                                • eSales - Order Quote Process

                                                                                                                                                • eSales - Modify Order Process

                                                                                                                                                • eSales - Reorder Process

                                                                                                                                              • The field value of Quote Type for the current quote record can be Persistent Cart, Auction Quote, or Quotation. When the quote type is not Auction Quote, if the application supports persistent Shopping Carts, the quote type is changed to Persistent Cart.

                                                                                                                                                Arguments for the MoveToCart Method

                                                                                                                                                The arguments for the MoveToCart method are shown in the following table.

                                                                                                                                                Name Type Data Type Optional Comments

                                                                                                                                                Quote Id

                                                                                                                                                Input

                                                                                                                                                String

                                                                                                                                                Y

                                                                                                                                                Not used.

                                                                                                                                                ReturnVal

                                                                                                                                                Output

                                                                                                                                                String

                                                                                                                                                Y

                                                                                                                                                Returns Success or Fail. Not used.

                                                                                                                                                  Pseudo-Algorithm for MoveToCart

                                                                                                                                                  1. Set the CurrentQuoteId profile attribute to the quote record ID. As the MoveToCart method is row-sensitive, the current record in the Quote business component is the record to move to the Shopping Cart.

                                                                                                                                                  2. If the PriceListId profile attribute is not empty and if the Price List Id field in this quote record <> PriceListId profile attribute, then change the Price List Id for this quote. This triggers a reprice. Note that you need to use DefaultPriceListId instead of PriceListId if the user is not associated with an account that has a default price list.

                                                                                                                                                  3. If Quote Type is not Persistent Cart or Auction Quote, change it to Persistent Cart.

                                                                                                                                                    RepriceQuote Method

                                                                                                                                                    RepriceQuote reprices the quote.

                                                                                                                                                      Preconditions for Calling the RepriceQuote Method

                                                                                                                                                      None.

                                                                                                                                                        Arguments for the RepriceQuote Method

                                                                                                                                                        The arguments for the RepriceQuote method are shown in the following table.

                                                                                                                                                        Name Type Data Type Optional Comments

                                                                                                                                                        Quote Id

                                                                                                                                                        Input

                                                                                                                                                        String

                                                                                                                                                        Y

                                                                                                                                                        ID for the quote record to be repriced.

                                                                                                                                                        Error Message

                                                                                                                                                        Output

                                                                                                                                                        String

                                                                                                                                                        Y

                                                                                                                                                        Error message, if any.

                                                                                                                                                        Return Error Code

                                                                                                                                                        Input

                                                                                                                                                        String

                                                                                                                                                        Y

                                                                                                                                                        Does not return an error if equal to N.

                                                                                                                                                        ReturnVal

                                                                                                                                                        Output

                                                                                                                                                        String

                                                                                                                                                        Y

                                                                                                                                                        Returns Success or Fail. Not used.

                                                                                                                                                          Pseudo-Algorithm for RepriceQuote

                                                                                                                                                          1. Position the Quote business component on the record indicated by the Quote Id input argument.

                                                                                                                                                          2. Call Pricing Manager to get the current price list ID:

                                                                                                                                                            If this price list ID is different from the quote record's price list Id, then change the quote record's price list ID.

                                                                                                                                                            SelectPrimary Method

                                                                                                                                                            This method is used to select a row from the picklist.

                                                                                                                                                              Preconditions for Calling the SelectPrimary Method

                                                                                                                                                              None.

                                                                                                                                                                Arguments for the SelectPrimary Method

                                                                                                                                                                The arguments for the SelectPrimary method are shown in the following table.

                                                                                                                                                                Name Type Data Type Optional Comments

                                                                                                                                                                PickList Field

                                                                                                                                                                Input

                                                                                                                                                                String

                                                                                                                                                                Y

                                                                                                                                                                Name of the field that has the picklist.

                                                                                                                                                                Primary ID Field

                                                                                                                                                                Input

                                                                                                                                                                String

                                                                                                                                                                Y

                                                                                                                                                                Primary Id field.

                                                                                                                                                                Primary Row Id

                                                                                                                                                                Input

                                                                                                                                                                String

                                                                                                                                                                Y

                                                                                                                                                                Row ID for the picklist.

                                                                                                                                                                ReturnVal

                                                                                                                                                                Output

                                                                                                                                                                String

                                                                                                                                                                Y

                                                                                                                                                                Returns Success or Fail. Not used.

                                                                                                                                                                  Pseudo-Algorithm for SelectPrimary

                                                                                                                                                                  1. Get and check the input arguments.

                                                                                                                                                                  2. Get the picklist business component from the Quote business component with the PickList Field input argument.

                                                                                                                                                                  3. Set the search specification using either the Primary Row Id or Primary ID Field input argument.

                                                                                                                                                                  4. Pick the first row if an active row exists;

                                                                                                                                                                    Else clear the picklist.

                                                                                                                                                                  5. Write and refresh the business component.

                                                                                                                                                                    SetBusCompFields Method

                                                                                                                                                                    This method is used to set a list of fields in a business component.

                                                                                                                                                                      Preconditions for Calling the SetBusCompFields Method

                                                                                                                                                                      None.

                                                                                                                                                                        Arguments for the SetBusCompFields Method

                                                                                                                                                                        The arguments for the SetBusCompFields method are shown in the following table.

                                                                                                                                                                        Name Type Data Type Optional Comments

                                                                                                                                                                        Business Object

                                                                                                                                                                        Input

                                                                                                                                                                        String

                                                                                                                                                                        N

                                                                                                                                                                        Business object.

                                                                                                                                                                        Business Component

                                                                                                                                                                        Input

                                                                                                                                                                        String

                                                                                                                                                                        N

                                                                                                                                                                        Business component.

                                                                                                                                                                        Search Field

                                                                                                                                                                        Input

                                                                                                                                                                        String

                                                                                                                                                                        Y

                                                                                                                                                                        Field on the business component.

                                                                                                                                                                        Search Value

                                                                                                                                                                        Input

                                                                                                                                                                        String

                                                                                                                                                                        Y

                                                                                                                                                                        Value to be set to the search specification.

                                                                                                                                                                        <Field Name1>

                                                                                                                                                                        Input

                                                                                                                                                                        String

                                                                                                                                                                        Y

                                                                                                                                                                        Name/value pair.

                                                                                                                                                                        <Field Name2>

                                                                                                                                                                        Input

                                                                                                                                                                        String

                                                                                                                                                                        Y

                                                                                                                                                                        Name/value pair.

                                                                                                                                                                          Pseudo-Algorithm for SetBusCompFields

                                                                                                                                                                          1. Get the required inputs to get an instance of the business component.

                                                                                                                                                                          2. Get the search specification fields:

                                                                                                                                                                            If they are passed, then set the search specification on the business component.

                                                                                                                                                                          3. Query the business component if it has not been queried or if the search specification is passed.

                                                                                                                                                                          4. Go through all the input arguments for <Field Name n> and set the value to the business component.

                                                                                                                                                                          5. Write to the record.

                                                                                                                                                                            ValidatePayment Method

                                                                                                                                                                            This method is used to validate the payment information for either a purchase order or a credit card.

                                                                                                                                                                              Preconditions for Calling the ValidatePayment Method

                                                                                                                                                                              None.

                                                                                                                                                                                Arguments for the ValidatePayment Method

                                                                                                                                                                                The arguments for the ValidatePayment method are shown in the following table.

                                                                                                                                                                                Name Type Data Type Optional Comments

                                                                                                                                                                                PO Number

                                                                                                                                                                                Input

                                                                                                                                                                                String

                                                                                                                                                                                N

                                                                                                                                                                                Purchase order number.

                                                                                                                                                                                Credit Card Number

                                                                                                                                                                                Input

                                                                                                                                                                                String

                                                                                                                                                                                Y

                                                                                                                                                                                Credit card number.

                                                                                                                                                                                Credit Card Type

                                                                                                                                                                                Input

                                                                                                                                                                                String

                                                                                                                                                                                Y

                                                                                                                                                                                Credit card type.

                                                                                                                                                                                Expiration Month

                                                                                                                                                                                Input

                                                                                                                                                                                String

                                                                                                                                                                                Y

                                                                                                                                                                                Expiration month.

                                                                                                                                                                                Expiration Year

                                                                                                                                                                                Input

                                                                                                                                                                                String

                                                                                                                                                                                Y

                                                                                                                                                                                Expiration year.

                                                                                                                                                                                Return Error Code

                                                                                                                                                                                Input

                                                                                                                                                                                String

                                                                                                                                                                                N

                                                                                                                                                                                Does not return an error if equal to N.

                                                                                                                                                                                Error Message

                                                                                                                                                                                Output

                                                                                                                                                                                String

                                                                                                                                                                                N

                                                                                                                                                                                Error message, if any.

                                                                                                                                                                                Note: If you want to perform credit card validation on a business component other than Quote, the business component must be either based on the CSSBCBase class, based on a class that is itself based on the CSSBCBase class, or based on a class that inherits from the CSSBCBase class, such as CSSBCQuote. For more information, see the section on credit card user properties in Using Siebel Tools.

                                                                                                                                                                                  Pseudo-Algorithm for ValidatePayment

                                                                                                                                                                                  1. Check what kind of payment is entered by checking the PO Number and Credit Card Number input arguments.

                                                                                                                                                                                  2. If PO Number has a value, then the payment information is valid.

                                                                                                                                                                                  3. If Credit Card Number has a value, then get all the required fields.

                                                                                                                                                                                  4. Pass the credit card information to the Credit Card Transaction Service business service to validate the information.

                                                                                                                                                                                    ValidateAddress Method

                                                                                                                                                                                    This method is used to validate the address information by checking to see that the necessary information has been entered. Input argument names are used in any error messages.

                                                                                                                                                                                      Preconditions for Calling the ValidateAddress Method

                                                                                                                                                                                      None.

                                                                                                                                                                                        Arguments for the ValidateAddress Method

                                                                                                                                                                                        The arguments for the ValidateAddress method are shown in the following table.

                                                                                                                                                                                        Name Type Data Type Optional Comments

                                                                                                                                                                                        Street Address

                                                                                                                                                                                        Input

                                                                                                                                                                                        String

                                                                                                                                                                                        N

                                                                                                                                                                                        State

                                                                                                                                                                                        Input

                                                                                                                                                                                        String

                                                                                                                                                                                        N

                                                                                                                                                                                        City

                                                                                                                                                                                        Input

                                                                                                                                                                                        String

                                                                                                                                                                                        N

                                                                                                                                                                                        Country

                                                                                                                                                                                        Input

                                                                                                                                                                                        String

                                                                                                                                                                                        N

                                                                                                                                                                                        Postal Code

                                                                                                                                                                                        Input

                                                                                                                                                                                        String

                                                                                                                                                                                        N

                                                                                                                                                                                        Return Error Code

                                                                                                                                                                                        Input

                                                                                                                                                                                        String

                                                                                                                                                                                        N

                                                                                                                                                                                        Do not return an error if equal to N.

                                                                                                                                                                                        Error Message

                                                                                                                                                                                        Output

                                                                                                                                                                                        String

                                                                                                                                                                                        N

                                                                                                                                                                                        Error message, if any.

                                                                                                                                                                                          Pseudo-Algorithm for Validate Address

                                                                                                                                                                                          Go through all the input arguments and make sure that the values are not null.

                                                                                                                                                                                            SetPendingRequest Method

                                                                                                                                                                                            This method is used to set the Profile attribute Pending Request, which is used to continue an operation after login.

                                                                                                                                                                                            Arguments:

                                                                                                                                                                                            • SWEApplet

                                                                                                                                                                                            • SWECmd

                                                                                                                                                                                            • SWEMethod

                                                                                                                                                                                            • SWENeedContext

                                                                                                                                                                                            • SWEReqRowId

                                                                                                                                                                                            • SWEService

                                                                                                                                                                                            • SWEShowPopup

                                                                                                                                                                                            • SWEView

                                                                                                                                                                                            Usage:

                                                                                                                                                                                            These arguments are used to setup pending requests to Siebel Web Engine.