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

Rookie Asked on April 7, 2020 in SuiteScript.

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.

on April 7, 2020.

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 =‘” + finalURL +”‘,’_blank’);”;

form.addButton(‘custpage_testbutton_2’, ‘Click here’,script );


on April 8, 2020.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor