Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Call function using addButton in Suitelet
Hi,
I am having trouble calling a function using the .addButton function in a suitelet.
I have a tiny snippet here.
function main(request, response)
{
var form = nlapiCreateForm('Purchase Order Confirmation', true);
form.setScript('customscript336'); //Script id of a client script
form.addButton('custpage_button','SUBMIT', "talert();"); //talert() contains functions such as nlapiLoad, nlapiSubmit, etc
//write the form on the reponse of the Suitelet
response.writePage( form );
}
I am using an external URL (Available Without Login). The problem is, I cannot use functions such as nlapiLoad, nlapiSubmitFIeld, etc with the .addButton. However, with the INTERNAL url, everything works fine. Does anyone have an alternative or ran into this problem and can provide a solution with the .addButton dealing with external Urls?