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!
Don’t miss your chance to meet our SuiteGurus—NetSuite Support professionals and subject matter experts with extensive experience in select product areas, including OneWorld, Advanced & Basic Accounting, Supply Chain Management, Receivables & Payables, CRM, Account Administration, and the SuiteCloud Platform. Full Conference attendees can prebook exclusive 30-minute one-on-one sessions for your product questions.
Spots are limited! Register through your Agenda Builder and find SuiteGuru under Agenda Enhancements.
Commit line using serverscripts
Help! Help!!
I have a serverscript to create a brand new invoice when an invoice fulfilling certain conditions is saved. I get the following error:
Script: invoiceAfterSave Error: USER_ERROR You must enter at least one line item for this transaction
I'm quite sure I'm missing the code to commit the new line - can anyone tell me what function to use for this?
Relevant portions of my code:
function invoiceAfterSave(type)
{
if (type.toLowerCase() == 'create')
{
var newRecord = nlapiGetNewRecord();
.....
var record = nlapiCreateRecord('invoice')
record.setFieldValue('entity', newRecord.getFieldValue('custbodybilling_customer'));
record.setFieldValue('location', 1);
nlapiSetLineItemValue('item', 'item', 1, "Servicing");
nlapiSetLineItemValue('item', 'quantity',1, 1);