{"type":"error.SuiteScriptError","name":"INVALID_S...
# suitescript
v
Copy code
{
  "type": "error.SuiteScriptError",
  "name": "INVALID_SCRIPT_TYPE_FOR_FORM",
  "message": "This API is only supported in client entry point scripts and custom modules.",
  "stack": [
    "attachClientScriptFileAndReturnModulePath(N/serverWidgetUtility)",
    "onRequest(/SuiteScripts/Dynappco/suitelets/sl_currency_revaluation.js:27)"
  ],
  "cause": {
    "type": "internal error",
    "code": "INVALID_SCRIPT_TYPE_FOR_FORM",
    "details": "This API is only supported in client entry point scripts and custom modules.",
    "userEvent": null,
    "stackTrace": [
      "attachClientScriptFileAndReturnModulePath(N/serverWidgetUtility)",
      "onRequest(/SuiteScripts/Dynappco/suitelets/sl_currency_revaluation.js:27)"
    ],
    "notifyOff": false
  },
  "id": "",
  "notifyOff": false,
  "userFacing": false
}
n
What have you done to get that error?
p
What is on
line 27
in your
sl_currency_revaluation.js
?
v
form.clientScriptModulePath = './mr_currency.js';
this is at line 27
n
what is that mr_currency.js file?
v
it has just a functiona to process the details.
n
"just a function", wanna share? 🙂
only you line to include that script seems to be the one that trips up so maybe it's the content,
v
function (search, record) { function getInputData() { function processOpenCurrencyRevaluation(scriptParameterSubsidiary,scriptParameterPostingPeriod){ log.debug('entering mr script'); var subsidiary = scriptParameterSubsidiary; var postingperiod = scriptParameterPostingPeriod; log.debug('subsidiary',subsidiary); log.debug('postingperiod',postingperiod); } } return{ getInputData : getInputData } }
n
You appear to have made some kinda of weird incomplete map/reduce script "thing" 🧐
p
He appeared to attach M/R script to SL via clientScriptModulePath.
n
Indeed but that's not even correct.
v
yes i attach the MR script to SL via this line.
how to correct this?
p
Options: 1. If possible, change the logic to backend Suitelet 2. If not, call backend Suitelet that will call M/R script for batch processing via N/task module. Otherwise you are limited to Client Script = button.
n
You could just have a submit button and schedule the m/r task in the POST. simples.
v
where to add the task module? in SL?
n
the same place you add record or search or any other module
Honestly it sounds like you don't even need a map reduce, you probably just need to do some processing in the POST but it's not clear what you're trying to do with the 2 field values.
v
actually the work on the Map/Reduce is yet to follow. its not yet started. now its jus the field values should be sent to the Map/Reduce script once the button is clicked.
n
Yeah but you don't attach a m.r to a suitelet. I've DM'd you if you need further help feel free to read and reply.
r
@vennila ramasamy See your original comment. I shared the whole UE->CL->SL->MR design pattern.
I haven't been able to suss out whether you need all those parts, but that's what I use to offload processing to a queue based on a user event.
141 Views