How to pass record_id into suitelet from beforeLoad ?
I want to add a button to sales order. On Click: It should run a Suitelet which displays a pdf containing so_id(tranid) and Customer name(entity). All is ok but on pdf it is showing null as fieldVAlue. Please help . Thanks
battk
You will want to share your code, or describe a lot more. There are several ways you can get a button to make a request to a suitelet, and several ways you can make the suitelet display a pdf. You might also need to share the expressions used in your templates as well.
Custom Adm.
Thanks man. It is done. I used request.getParameter(recId); recid is the record id passed from beforeLoad. You can see the code below:
function addButtonBeforeLoad(type,form)
{
if(type == ‘view’)
{
var linkURL = nlapiResolveURL(‘SUITELET’, ‘customscript_suiteletforbutton’, ‘customdeploy1’, null);
var param = ‘&recId=’+nlapiGetRecordId()+’&recType=’+nlapiGetRecordType()
var finalURL = linkURL+param;
var script= “win = window.open(‘” + finalURL +”‘,’_blank’);”;
form.addButton(‘custpage_testbutton_2’, ‘Click here’,script );
}
}