Hello, Tell please how can i replace this script w...
# suitescript
m
Hello, Tell please how can i replace this script which gives:
Copy code
All SuiteScript API Modules are unavailable while executing your define callback.
b
netsuite executes the callback function passed to the define function
netsuite throws that error if during that process a suitescript module is used
so dont use suitescript modules during the define callback
m
UserEvent Execute callback module and callback module don't support N/module?
Copy code
UserEvent -> MyModule -> N/SuiteScript Module
b
not in the callback function
you can return functions that use suitescript modules, and thats the usual pattern scripts
m
Please Help UserEvent:
Copy code
define([
  'N/record',
  'N/search',
  'Misc/MyUtils'
], callback)
MyUtils:
Copy code
define([
  'N/record',
  'N/search',
  'Misc/MyConst'
], callback)
b
none of what you share is the callback function
m
like this :
Copy code
define([...'moduleA'], () => {
afterSubmit:() => {
  moduleA()
}
})
Copy code
define([...], () => {
  moduleA: () => {}
})
b
that is the callback functions
none of what you shared so far uses a suitescript module in the define callback
which means you should start looking in Misc/MyConst
m
All my Modules has callback but
Copy code
define([], callback)
function callback() {
this.CONST = 1
return this
}
b
none of what you shared would cause the error
you are likely not sharing the parts causing the problem
e
share the code, we can help.
m
thk, I am re-write my code