RE: Disqualified and new leads in dynamics 365
Thanks a lot for the response Mehdi. I'll try this now
I was earlier trying this code I'm unable to make it work correctly
Can i please get some help in altering this as per the requirement i mentioned?
function compareEmailID(executionContext){
var formContext = executionContext.getFormContext();
var emailID=formContext.getAttribute("emailaddress1").getValue();
Xrm.WebApi.retrieveRecord("lead", "?$select=emailaddress1&$filter=emailaddress1 eq '" + emailID + "'").then(
function success(result) {
if (result.length>0) {
Xrm.Page.ui.setFormNotification("This EmailID is exsited, please try another one!", "ERROR")
}
},
function error(error) {
Xrm.Navigation.openAlertDialog({ text: error.message });
}
);
}
Kindly Advise,
Best Regards,
Sumaira Noor