Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Run a function on button click
I want run a Script on a button click (because you cannot run a function in your script ona button click) I've followed the Suitescript documentation and am only able to get the first like (a log line) to run. Any idea?
` form.setScript('customscript_toloader') form.addButton('custpagetestbutton', 'TEST button', 'createTO();');`
-Other script
function createTO() //(request, response)
{
alert("This function was called");
//variable set up
nlapiLogExecution('DEBUG', 'script', 'runs 1');
var POID ;
var POType ;
var PORecord;
var lines;
nlapiLogExecution('DEBUG', 'script', 'runs 2');
var arrayName = new Array();
var arrayQty = new Array();
PORecord = nlapiGetNewRecord();
lines = PORecord.getLineItemCount('item');
POID = nlapiGetRecordId();