Siebel Interactive Selling Transact Server Interface Reference > The Shopping Cart > Error Handling >

onLoad Error Handling


If an error has occurred before the page has finished processing, it can be caught and conveyed to the user as part of the page's onLoad event. The shopping cart recognizes the types of errors listed in this section, which you handle by defining a JavaScript function in ShoppingCart.jsp with the same name and no arguments. These functions are most likely to be implemented to display a JavaScript alert box telling the user more about the error, its possible consequences, and what they should do next. Your error handling function will be called automatically in the onLoad handler by calling the ShoppingCartBean function getCartOnLoad as follows:

<body bgcolor=#FFFFFF onLoad="<%= bean.getCartOnLoad() %>">>

ConfigChangedError

This is a concurrency error: Another user changed the saved configuration this user is trying to add to the cart. This error should rarely occur. The user should try to reopen the saved configuration to see the changes made by the other user, and add it to the cart again.

The default definition of this error handling function is:

function ConfigChangedError() {
alert("The configuration you wanted to add to your cart\n has been changed by another user!\nPlease try again!");
}

QuoteChangedError

This is a concurrency error. It is thrown when two users are modifying the same saved quote simultaneously. The user who updates the quote first does so successfully. The second user to try to update the quote gets this error and sees the quote as the first user has saved it. The second user may then reapply his or her changes and update again.

The default definition of this error handling function is:

function QuoteChangedError() {
alert("This quote was changed by another user!\nThe changes they made are shown here.\nPlease make your changes again!");
}

NoPermissionToChangeError

If the current user is viewing a quote which has been sent by email, then that quote was created by another user and unless he or she has group or super permission granted to them by Transact, that user cannot modify the quote. If the user attempts to make a change to the quote, it will not be saved and Transact returns this error. Users can create their own copy of the quote by choosing "Save New" on save, and can make any desired changes to their own copy.

The default definition of this error handling function is:

function NoPermissionToChangeError() {
alert("Sorry, this quote was created by another user and you do not have permission to modify it. Click Save Quote and choose Save New to save your own copy of this quote.");
}

QuoteDeletedError

If the current quote has been deleted, then the user can no longer modify or view it (it no longer exists). The creator of the quote is the only user with permission to delete it.

The default definition of this error handling function is:

function QuoteDeletedError() {
alert("This quote has been deleted from the database by the user who created it! It is no longer valid.");
}

AddToCartError

If an error occurs while a user is adding to the cart, the configuration the user tried to add will not appear in the cart interface. You should communicate this to the user. Then, the user can try to add the configuration to the cart again.

The default definition of this error handling function is:

function AddToCartError() {
alert("An error occurred on the server while adding to the cart!\nPlease try again or contact your system administrator!");
}

DeleteError

This error is thrown when users try to delete a line item from a quote they did not create. Only the creator of the quote has delete permission. The line item they tried to delete remains on the quote.

The default definition of this error handling function is:

function DeleteError() {
alert("Sorry, but you can't remove items from another user's cart!\nSave a new copy of this cart if you want to remove line items.");
}

ServerError

This error is a catch-all for all the other unspecified errors that might happen during the initialization of the Shopping Cart.jsp page that are not described above. If this error is thrown, changes that the user made to the cart in their last operation might not be displayed.

The default definition of this error handling function is:

function ServerError() {
alert("An error occurred during the operation you tried to perform! Please try again or contact your system administrator.");
}


 Siebel Interactive Selling Transact Server Interface Reference 
 Published: 18 April 2003