Dears, good morning,
I'm running the code below, but the getSaveMode event isn't working anymore, would you know why?
function End (executionContext)
{
debugger;
try
{
var formContext = executionContext.getFormContext ();
var currentUserRoles = Xrm.Utility.getGlobalContext (). userSettings.securityRoles;
for (var i = 0; i <currentUserRoles.length; i ++)
{
Xrm.WebApi.online.retrieveMultipleRecords ("role", "? $ Select = name & $ filter = roleid eq" + currentUserRoles [i] + ""). Then
(
function success (results)
{
var AccessAccess = results.entities [0] ["name"];
if (RightAccess! = "XXX")
{
var eventArgs = executionContext.getEventArgs ();
if (eventArgs.getSaveMode () == 58)
{
eventArgs.preventDefault ();
}
}
},
function (error) {
Xrm.Utility.alertDialog (error.message);
}
);
}
}
catch (e)
{
alert ("Error in END function:" + e.message);
}
}
Thank you