Siebel eSales Administration Guide > Shopping Service API > User Action Methods >

AddToFavoriteList


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

Expected Preconditions Before the Method Can Be Called

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

Table 36. Necessary Business Components in the Business Object
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

The AddToFavoriteList method has the arguments shown in Table 37.

Table 37. AddToFavoriteList Arguments
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 will navigate to this view after completing the AddToFavoriteList action.
ReturnVal
Output
String
Y
Returns Success or Fail. Not used.

Pseudo-Algorithm

  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;
  4. If there is a existing record, go to step 4;

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

  5. Query the Favorite List Item business component with the search specification [Product Id] = input product ID;
  6. If there is an existing record, go to step 5;

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

  7. If GotoView input argument is not empty, navigate to the specified view and End;
  8. 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.


 Siebel eSales Administration Guide 
 Published: 18 April 2003