1
votes

can any one please tell or share snippet on how to either call user event script or scheduled script from suite by passing parameters. I have a suitelet with all the records and for each record I have the check box as prefix, once the suitelet loads user can select the records by checking each check box once he selection is made and click on the submit button I need to pass the selected values to the script (can be user event script or scheduled script). any suggestions are most appreciated. Thanks in advance.

3
You should show us something you tried to get help.Christophe Weis

3 Answers

1
votes

You could use nlapiScheduleScript() to pass the parameters over as an object to a Scheduled Script and put it into the scheduling queue.

You'd need to define the parameters in the script record in NetSuite. You can take a look at the 'Scheduling APIs' help article in NetSuite for more robust documentation (or look at SuiteAnswers Article 10279).

The syntax for nlapiScheduleScript is:

nlapiScheduleScript(scriptId, deployId, params);
0
votes

There is no explicit way of firing user event scripts from scheduled scripts, other than creating/updating/deleting the record itself and you can't pass parameters other than by updating/setting a field value on the record itself.

Like @morethanawesome said, you can use nlapiScheduleScript() to fire a schedule script and pass parameters to it.

0
votes

There is a no way to call User-Event script from scheduled script,But when you submit the record after creation or editing the existing one using nlapiSubmitRecord at that time the Usre-Event of that record's will executed.

SO,using this way you can call otherwise there is a no way to do this using API.

Thanks, Mayur