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 ); /* * Save order */ id = nlapiSubmitRecord(record, true); /* * Pack up return data */ returnData = new soReturnData(); returnData.id = id; returnData.record = nlapiLoadRecord("salesorder", id ); /* * next line returns: * so.tobeemailed='T' :: record.tobeemailed='F' */ nlapiLogExecution('DEBUG', ' so.tobeemailed=' + so.tobeemailed + ' :: record.tobeemailed=' + record.getFieldValue('tobeemailed')); return returnData; } The Sales order is created. Everything works as expected apart from:so.tobeemailed = 'T' but the record (after saving) returns 'F'.Checking the Sales Order, There is no tick next to 'To Be Emailed' (but there is the email address NEXT to the unticked box I used).Also, oddly when viewing the System Notes of the Sales Order, there is an entry for set "to be emailed" but it doesn't contain 'T', it contains my email address.Anyone have any ideas?