
Announcements
(function (global) {
global.namespaceMain = global.namespaceMain || {};
global.namespaceMain.helpers = {
usefulFunction1: function (formContext, foo) {
formContext.doThings1With(foo);
},
usefulFunction2: function (formContext, bar) {
formContext.doThing2With(bar);
},
usefulFunction3: function (formContext, baz) {
formContext.doThing3With(baz);
}
};
})(globalThis);
(function (global) {
global.namespaceMain = global.namespaceMain || {};
//How can I do this here: fetch web resource and run it
global.namespaceMain.form1 = {
onload: function (executionContext) {
const formContext = executionContext.getFormContext();
//If we need to pass executionContext to fetch web resource do it here (plan b)
formContext.doThingsOnLoad();
},
onChangeField1: function (executionContext) {
const formContext = executionContext.getFormContext();
global.namespaceMain.helpers.usefulFunction1(formContext, foo)
formContext.doThingsOnChangeField1();
},
onChangeField2: function (executionContext) {
const formContext = executionContext.getFormContext();
global.namespaceMain.helpers.usefulFunction2(formContext, bar)
formContext.doThingsOnChangeField2();
},
onChangeField3: function (executionContext) {
const formContext = executionContext.getFormContext();
global.namespaceMain.helpers.usefulFunction3(formContext, baz)
formContext.doThingsOnChangeField3();
},
};
})(globalThis);