Discussions
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
How to fetch DEFAULT LEAD TIME in Inventory Management Preferences via suitescript
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",