I am working on writing a scriptable cart script. It currently does (or is suppose to do) 2 things, it won't let you add a specific item to the cart and it won't let you add something that is already in the cart to the cart. Here is the script:
function customValidateLine(type) { if (type != 'item') { return true; } var itemId = nlapiGetCurrentLineItemValue('item','item'); if (itemId == "302"){ return false; } var qty = parseInt(nlapiGetCurrentLineItemValue('item','quantity')); if (qty &gt; 1){ return false; } return true; } Currently the qty part of script works. It returns an error saying line validation failed. Item 302 is still allowed to be added to the cart. Please note that I am using multi to add multiple items to the cart in one form submit. Questions: 1. Why can I still add item 302 to the cart? It is being passed in with:<input type="hidden" name="multi" value="302,1;xxx,1;etc">2. When I catch the qty, how can I get it to just fail silently instead of throwing an error?3. Is there a good way to debug these scripts? Thanks