Reputation: 11
I am a NetSuite Administrator but have not had much programming experience. I am trying to build a simple script that will send an email, before a record is deleted, with information from the record being deleted. I have done research online and think I have a good base here but I'm getting the error: "Syntax error: missing : after property id" when I try to upload my script.
function SendJEworkflowAction(){
nlapiSendEmail(38214, '[email protected]',
'Fulfillment with Journal Entry Deleted',
{custbody_bpc_journal_entry}
);
nlapiLogExecution('emailsent', mlapiGetRecordId());
}
Any guidance would be greatly appreciated!
Thank you!
Upvotes: 1
Views: 949
Reputation: 3029
You probably want to load the record and stringify it. Make sure you are doing this beforeSubmit. Try this:
function SendJEworkflowAction(){
var record = nlapiLoadRecord(nlapiGetRecordType(),nlapiGetRecordId());
nlapiSendEmail(38214, '[email protected]',
'Fulfillment with Journal Entry Deleted',
JSON.stringify(record)
);
nlapiLogExecution('emailsent', nlapiGetRecordId());
}
Upvotes: 2