mehmet
06/21/2022, 7:06 PMconst subTab = form.addTab({
id: "custpage_tab_mehmet",
label: "MTab",
});
const subList = form.addSublist({
id: "custpage_sublist_mehmet",
label: "MSublist",
tab: "custpage_tab_mehmet",
type: ui.SublistType.STATICLIST
});
subList.addField({
id: "custpage_column_one",
label: "Col 1",
type: ui.FieldType.TEXT
})
for (let index = 0; index < 30; index++) {
subList.setSublistValue({
id: "custpage_column_one",
line: index,
value: `col1 row${index}`
});
}
battk
06/21/2022, 10:46 PMmehmet
06/22/2022, 2:47 AMexport let beforeLoad: EntryPoints.UserEvent.beforeLoad = (
context: EntryPoints.UserEvent.beforeLoadContext
): void => {
let form = context.form;
// Above code goes here.
}
This is pretty much it.battk
06/22/2022, 3:25 AMbattk
06/22/2022, 3:25 AMbattk
06/22/2022, 3:27 AMmehmet
06/22/2022, 3:57 AM/**
* @NApiVersion 2.1
* @NScriptType UserEventScript
*/
import { EntryPoints } from "N/types";
import * as ui from "N/ui/serverWidget";
export let beforeLoad: EntryPoints.UserEvent.beforeLoad = (
context: EntryPoints.UserEvent.beforeLoadContext
): void => {
let form = context.form;
const subTab = form.addTab({
id: "custpage_tab_mehmet",
label: "MTab",
});
const subList = form.addSublist({
id: "custpage_sublist_mehmet",
label: "MSublist",
tab: "custpage_tab_mehmet",
type: ui.SublistType.STATICLIST
});
subList.addField({
id: "custpage_column_one",
label: "Col 1",
type: ui.FieldType.TEXT
})
for (let index = 0; index < 30; index++) {
subList.setSublistValue({
id: "custpage_column_one",
line: index,
value: `col1 row${index}`
});
}
};
mehmet
06/22/2022, 3:59 AMbattk
06/22/2022, 4:09 AMmehmet
06/22/2022, 4:11 AM/**
* @NApiVersion 2.1
* @NScriptType UserEventScript
* @NAmdConfig ./JsLibraryConfig.json
*/
define(["require", "exports", "N/ui/serverWidget"], function (require, exports, ui) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.beforeLoad = function (context) {
var form = context.form;
var subTab = form.addTab({
id: "custpage_tab_mehmet",
label: "MTab",
});
var subList = form.addSublist({
id: "custpage_sublist_mehmet",
label: "MSublist",
tab: "custpage_tab_mehmet",
type: ui.SublistType.STATICLIST
});
subList.addField({
id: "custpage_column_one",
label: "Col 1",
type: ui.FieldType.TEXT
});
for (var index = 0; index < 30; index++) {
subList.setSublistValue({
id: "custpage_column_one",
line: index,
value: "col1 row" + index
});
}
};
});
battk
06/22/2022, 4:13 AM* @NAmdConfig ./JsLibraryConfig.json
is missingmehmet
06/22/2022, 4:14 AM{
"paths": {
"crypto-js": "./lib/crypto-js.js",
"uuid": "./lib/uuid.min.js"
}
}
mehmet
06/22/2022, 4:14 AMbattk
06/22/2022, 4:14 AMbattk
06/22/2022, 4:14 AMmehmet
06/22/2022, 4:15 AMbattk
06/22/2022, 4:16 AMmehmet
06/22/2022, 4:16 AMbattk
06/22/2022, 4:28 AMbattk
06/22/2022, 4:28 AMbattk
06/22/2022, 4:28 AMbattk
06/22/2022, 4:28 AMmehmet
06/24/2022, 8:20 PMClient
execution context to the script deployment once that was given dropdown started working as expected.mehmet
06/24/2022, 8:20 PM