{Power 2021}Exception handling and notification in Model driven Apps Scripts

Sending
User Review
0 (0 votes)

Hi All,

In this video supported blog I am going to tell about Exception handling in your scripts in Model driven Apps and how to notify the user in meaningful way.

[embedded content]

Here is the code sample used in above video example:

function onLoad(executionContext)
{
try
{
var formContext = executionContext.getFormContext();
formContext.getAttribute(“gendercode1”).setValue(0);
}
catch (exception)
{
var exceptionAlertString =
{
confirmButtonLabel: “Ok”,
text: “On Load error: ” + exception.message
};
var exceptionAlertOption =
{
height: 120,
width: 260
};
Xrm.Navigation.openAlertDialog(exceptionAlertString, exceptionAlertOption);
}
}

Hope it helps and Power 365ing as usual!

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?

Problem Area – Technical, Functional, Training, Development or consulting?

I am here to help, get in touch here: Click here

clip_image007