Ingorca
05/12/2022, 3:18 PMError
Fail to evaluate script: {"type":"error.SuiteScriptModuleLoaderError","name":"{stack=[Ljava.lang.Object;@41320eed, toJSON=org.mozilla.javascript.InterpretedFunction@3c5d36f5, name=MODULE_DOES_NOT_EXIST, toString=org.mozilla.javascript.InterpretedFunction@3748319, id=, message=Module does not exist: N/redirect.js, TYPE=error.SuiteScriptModuleLoaderError}","message":"","stack":[]}
Is it due to the redirection module that I added in the gpspositionButtonUser()
function of my client script?
I put here the client script and the suitlet script.Martin
05/12/2022, 3:29 PMMartin
05/12/2022, 3:31 PMIngorca
05/12/2022, 3:34 PMIngorca
05/12/2022, 3:38 PMIngorca
05/12/2022, 3:41 PMIngorca
05/12/2022, 4:15 PMIngorca
05/12/2022, 4:15 PM/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(['N/record','N/redirect'], function (nCurrentRecord,nRedirect) {
function beforeLoad_addButton(scriptContext) {
var form = scriptContext.form;
form.addButton({
id : 'custpage_gpsuserbutton',
label : 'Arrivé',
functionName : 'gpspositionButtonUser()'
//GpspositionButtonUser est la fonction exécuté pour capture la position GPS de l'utilisateur
});
form.clientScriptFileId = 223; //ceci est l'id de mon client script dans le file cabinet
}
function afterSubmit(scriptContext) {
nRedirect.toSuitelet({
scriptId: 224,
deploymentId: 1,
parameters: {
'soid': nCurrentRecord.get().id
}
})
}
return {
beforeLoad: beforeLoad_addButton,
afterSubmit:afterSubmit
}
});
Ingorca
05/12/2022, 4:16 PM*Notice (SuiteScript)* {"type":"error.SuiteScriptError","name":"InternalError","message":"missing ; before statement","stack":["createError(N/error)","beforeLoad_addButton(/SuiteScripts/event_buttonpositiongps.js:18)","createError(N/error)"],"cause":{"message":"missing ; before statement","fileName":"","lineNumber":1,"name":"InternalError","stack":"\tat /SuiteScripts/event_buttonpositiongps.js:18 (beforeLoad_addButton)\n\tat INVOCATION_WRAPPER$sys:26\n\tat INVOCATION_WRAPPER$sys:17\n\tat INVOCATION_WRAPPER$sys:34\n\tat INVOCATION_WRAPPER$sys:1\n","rhinoException":"org.mozilla.javascript.EvaluatorException: missing ; before statement"},"notifyOff":false,"userFacing":true}
Ingorca
05/12/2022, 4:17 PMbattk
05/12/2022, 7:32 PMIngorca
05/13/2022, 8:57 AMbattk
05/15/2022, 2:22 AMbattk
05/15/2022, 2:22 AM