Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Customize Lead Disqualify Button

Posted on by 475

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);
}
);


}

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans