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.
Please note that on Saturday, April 11, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 30 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Proplems setting Sales Order tobeemailed in Restlet
Fairly sure this was working before, but now its not
so I create a data structure like this:
so.tobeemailed = 'T'; so.tobeprinted = 'F'; so.email = 'me@email.com';
And send it (along with other data) to:
function S2_createSalesOrder( so ) { var record = nlapiCreateRecord('salesorder', {recordmode: 'dynamic'}); /* * set customer information */ record.setFieldValue('entity', so.customerId ); record.setFieldValue('billaddresslist', so.billAddressId ); record.setFieldValue('shipaddresslist', so.shipAddressId ); record.setFieldValue('tobeemailed', so.tobeemailed); record.setFieldValue('tobeprinted', so.tobeprinted); record.setFieldValue('email', so.email ); record.setFieldValue('memo', so.memo ); /* * Set department */ record.setFieldValue('department', so.departmentId); /* * Add items to order */ for ( x=0; x < so.items.length;x++ ) { var item = so.items[x]; record.selectNewLineItem('item'); record.setCurrentLineItemValue('item', 'item', item.internalId ); record.setCurrentLineItemValue('item', 'quantity', item.qty ); record.setCurrentLineItemValue('item', 'location', item.locationId ); record.commitLineItem('item'); } /* * Add shipping information */ record.setFieldValue('shipmethod', so.shipMethodId ); record.setFieldValue('shippingcost', so.shippingCost ); /* * Add payment information */ record.setFieldValue('paymentmethod', so.paymentMethodId ); /* 0