Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Do not save invoice loop script help
Hey all...
I'm still new to Suitescript.
We have an item call 'NEW ITEM' that represents an item not yet entered in Netsuite that reps can use temporarily. They can make a sales order, but are instructed not to convert to invoice. They must make a customer deposit, wait for the new item to be entered into the system, and then can correct the sales order and go to an invoice.
Reps seldom obey the rule and I need to prevent them from creating invoices from sales order with a 'NEW ITEM'. Otherwise it makes problems.
I wrote this code. It loops through the line item names to see if 'NEW ITEM' is one of them. It works as far as stopping them from saving the invoice with a new item and showing an alert, but my headache is that is also prevents an invoice without new items from saving as well. Nothing happens when clicking SAVE. I don't what else to put in here to make it work. I'm attaching this to the invoice record in the SAVE RECORD FUNCTION area.