ericbirdsall
10/09/2020, 4:46 PMlet allParameterIds = [];
let thisScript = record.load({
type: record.Type.SUITELET,
id: [YOUR SCRIPT ID]
});
let parameterCount = thisScript.getLineCount({
sublistId: 'parameters'
});
for (i = 0; i < parameterCount; i++) {
let currentParameterId = thisScript.getSublistValue({
sublistId: 'parameters',
fieldId: 'internalid',
line: i
});
allParameterIds.push(currentParameterId);
}
erictgrubaugh
10/09/2020, 5:01 PMerictgrubaugh
10/09/2020, 5:01 PMalien4u
10/09/2020, 5:03 PMericbirdsall
10/09/2020, 5:10 PMstalbert
10/09/2020, 5:33 PMerictgrubaugh
10/09/2020, 5:35 PMfunction readParameters() {
let script = runtime.getCurrentScript();
return {
errorAuthor: script.getParameter({name: "custscript_sma_errauthor"}),
errorRecipient: script.getParameter({name: "custscript_sma_errrecipient"}),
programSearch: script.getParameter({name: "custscript_sma_programsearch"})
};
}
I use a function that follows this pattern, but it's not intended to be reusable.ericbirdsall
10/09/2020, 5:44 PMstalbert
10/09/2020, 5:51 PMas const
to the end of that return statement objectstalbert
10/09/2020, 5:54 PMerictgrubaugh
10/09/2020, 5:59 PMObject.freeze
iterictgrubaugh
10/09/2020, 5:59 PMstalbert
10/09/2020, 5:59 PMstalbert
10/09/2020, 5:59 PMstalbert
10/09/2020, 6:00 PMerictgrubaugh
10/09/2020, 6:00 PMericbirdsall
10/09/2020, 6:00 PMericbirdsall
10/09/2020, 6:01 PMstalbert
10/09/2020, 6:02 PMconst
as I can (e.g. I tend to use const over var/let - doing so means any time I actually see a let
I know that variable is special and is getting mutated somewhere)stalbert
10/09/2020, 6:02 PMas const
being one such example)ericbirdsall
10/09/2020, 6:05 PMericbirdsall
10/09/2020, 6:12 PMstalbert
10/09/2020, 6:26 PMExtendApps Inc.
10/09/2020, 7:12 PM