Announcements
Hi,
I am currently managing a D365 instance, which is designed by someone else without proper documentation. So right now I am in the middle of nowhere. However, I am moving the scripts from Xrm. Page to contextual form concept which is a tedious task. I am facing so many issues while doing this simple to look migration. For example, I am just writing a simple piece of code (see below for code reference) and getting an error. Can someone please help me with that?
function accountFormOnLoad(executionContext) {
debugger;
var formContext = executionContext.getFormContext(); // get formContext
formContext.ui.clearFormNotification("1000");
var id = formContext.data.entity.getId();
/* if (id === "") return;
var agreementArray = [];*/
var level = "Info";
var message = "Active agreement " + "00738" + ": Callouts used day = " + "4" + " and night = " + "2";
/*if (id !== undefined) {*/
formContext.ui.setFormNotification("Hello", "Warning", id);
/*}*/
}
Error Message:
Log File:
UciError: Invalid value Warning for notificationLevel
at i (wewillfixitsandbox.crm4.dynamics.com/.../app.js
at p (wewillfixitsandbox.crm4.dynamics.com/.../app.js
at S (wewillfixitsandbox.crm4.dynamics.com/.../app.js
at wewillfixitsandbox.crm4.dynamics.com/.../8.js
at wewillfixitsandbox.crm4.dynamics.com/.../app.js
at wewillfixitsandbox.crm4.dynamics.com/.../app.js
at l._executeInternal (wewillfixitsandbox.crm4.dynamics.com/.../app.js
at l.execute (wewillfixitsandbox.crm4.dynamics.com/.../app.js
at v.execute (wewillfixitsandbox.crm4.dynamics.com/.../app.js
at ee.setFormNotification (wewillfixitsandbox.crm4.dynamics.com/.../8.js
Hello Waleed,
Thank you for your post on the community Forum.
The issue is related to the level set, it should be WARNING not Warning.
formContext.ui.setFormNotification("Hello", "WARNING", id);
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,807 Super User 2024 Season 2
Martin Dráb 229,135 Most Valuable Professional
nmaenpaa 101,156