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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
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