Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Adding Items to Cart Validation
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 > 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.
0