Discussions
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Unable to call Suitelet from addButton Userevent?
I am trying to load and email document when a button is clicked.Iam getting 'id' missing error. I am sure that I am not connecting them properly. Can anyone please suggest where am I doing wrong?
Suitelet:
function Email_SIForm(request, response)
{
var SOid = nlapiGetRecordId();
nlapiLogExecution('DEBUG', 'SOid', SOid);
var sorecrd = nlapiLoadRecord('salesorder',SOid);
var SI = sorecrd.getFieldValue('custbody_dwr_salesorder_si' );
nlapiLogExecution('DEBUG', 'SI', SI);
var file = nlapiLoadFile(SI);
nlapiLogExecution('DEBUG', 'file', file);
var newEmail = nlapiSendEmail(3, 'sru@test.com.au', 'Sample email and attachment', 'Please see the attached file', null, null, null, file);
}
UserEvent:
function beforeload_MojEmailFile(type, form, request){