Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
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",