Hello,
I want to customize disqualify lead button in a way that when specific status reason is selected on disqualify button i want to check one field on form whether value contains if not show alert message and make field required.
i have tried this on save event of form with below code but iam not getting selected status reason value instead of that iam getting initial loaded value.
Please suggest is there way to get selected status reason value or any other possible way to handle this??
if (executionContext.getEventArgs().getSaveMode() ==15 && formContext.getAttribute("statuscode").getValue() == 4 )
{
executionContext.getEventArgs().preventDefault();
formContext.getAttribute("contact").setRequiredLevel("required");
var alertStrings = { confirmButtonLabel: "Ok", text: "contact is Required", title: "Required" };
var alertOptions = { height: 120, width: 260 };
Xrm.Navigation.openAlertDialog(alertStrings, alertOptions).then(
function success(result) {
console.log("Alert dialog closed");
},
function (error) {
console.log(error.message);
}
);
}
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... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156