Marvin
05/18/2023, 2:57 AMUncaught TypeError: mod.reinstateAgency is not a function
Adding client script like this.
scriptContext.form.clientScriptModulePath = "/SuiteScripts/xxxx-scripts/record-automations/xxxx-cl-suspend-reinstate-agency.js";```
Adding button like this.
scriptContext.form.addButton({
id: "custpage_reinstate_button"
, label: "Reinstate"
, functionName: "reinstateAgency"
});
Client script has this to just test whether I can call the function.
/**
* @NApiVersion 2.1
*/
define([]
, () => {
return {
reinstateAgency: () => {
window.open("<https://google.com>");
}
, suspendAgency: () => {
window.open("<https://google.com>");
}
};
});battk
05/18/2023, 3:18 AMbattk
05/18/2023, 3:19 AMMarvin
05/18/2023, 3:19 AMbattk
05/18/2023, 3:20 AMMarvin
05/18/2023, 3:20 AMMarvin
05/18/2023, 3:37 AMmod: is for another button.
What's strange is that I get the same error when I try and do this from the button directly.
scriptContext.form.addButton({
id: "custpage_suspend_button"
, label: "Suspend TEFAP"
, functionName: "window.open(\"<https://google.com>\")"
});
Something similar is in the sample script in Netsuite help except that the url is an actual SuitLet url instead of Google.Marvin
05/18/2023, 3:38 AMscriptContext.form.clientScriptModulePath only be called once on a record?Marvin
05/18/2023, 3:47 AMWatz
05/18/2023, 5:51 AM