Hello,
I'm writing a Scheduled SuiteScript 2.1 which would benefit by fetching the default setting, to make the script more robust rather than hardcoding it.
The setting can be found this way via UI:
SETUP > ACCOUNTING > INVENTORY MANAGEMENT PREFERENCES
"DEFAULT LEAD TIME" setting
I tried the AI search, in the unlikely event it provides an accurate answer, but no such luck.
This code snippet, generates an error:
let invmgmtPrefs = config.load({
type: config.Type.INVENTORY_MANAGEMENT_PREFERENCES
});
let defLeadTime = invmgmtPrefs.getValue({
fieldId: 'LEADTIME'
});
ERROR:
"type": "error.SuiteScriptError",
"name": "SSS_MISSING_REQD_ARGUMENT",
"message": "config.load: Missing a required argument: options.type",
The SA article (https://suiteanswers.custhelp.com/app/answers/detail/a_id/43565) which documents the various "config.type" makes no mention of "Inventory Management Preferences".
Has anyone tried doing this successfully? If so, what is the config.type to use in this case?
Thanks in advance.