Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Disqualified and new leads in dynamics 365

(0) ShareShare
ReportReport
Posted on by 1,081

Hello Community Experts,

There is a requirement where, if a lead's status is disqualified and if i try to create a new lead with same email ID as that of disqualified lead, it should show an alert box or popup that "This lead already exist as disqualified" and it should not allow me to save that lead.

Kindly guide,

Best Regards,

Sumaira Noor

  • Sumaira Noor Profile Picture
    Sumaira Noor 1,081 on at
    RE: Disqualified and new leads in dynamics 365

    I found solution to this using web api

    Thanks all for taking time to look into my problem

    Best Regards,

    Sumaira Noor

  • Sumaira Noor Profile Picture
    Sumaira Noor 1,081 on at
    RE: Disqualified and new leads in dynamics 365

    Hi Mehdi,

    I would like to have the guidance on the scenario you mentioned

    Please guide,

    Best Regards,

    Sumaira Noor

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,212 User Group Leader on at
    RE: Disqualified and new leads in dynamics 365

    Hi,

    The easiest way is to display a pop-up and clear the email when you populate the email field with a duplicate. Let me know if you need more guidance to implement this scenario.

  • Sumaira Noor Profile Picture
    Sumaira Noor 1,081 on at
    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

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,212 User Group Leader on at
    RE: Disqualified and new leads in dynamics 365

    Hi, 

    You need a plugin: 

    https://mylearnings26.wordpress.com/2018/06/26/detect-duplicate-records-in-ms-crm-using-plugin-c/

  • Sumaira Noor Profile Picture
    Sumaira Noor 1,081 on at
    RE: Disqualified and new leads in dynamics 365

    Thanks a lot for the response Asif and Mequan

    The client is looking for some code to be triggered on "On save" which should throw an alert message or any pop up if the new email ID matches the email ID of disqualified leads

    Kindly guide,

    Best Regards

    Sumaira Noor

  • Suggested answer
    mequan Profile Picture
    mequan on at
    RE: Disqualified and new leads in dynamics 365

    Hi Noor,

    Based on your situation I will suggest you create a duplicate detection rule to fix this issue. For more details, you may check docs.microsoft.com/.../set-up-duplicate-detection-rules-keep-data-clean .

    Thanks and Best Regards

  • Suggested answer
    Asif365 Profile Picture
    Asif365 1,431 on at
    RE: Disqualified and new leads in dynamics 365

    Hi Sumaira,

    Please try to create Duplicate Detection Rule.

    When a record is created or updated. This rule will detect duplicates when a user creates or updates a record through the mobile client, Outlook client or web client.

    In the Duplicate Detection Rule Criteria section, in the Base Record Type list, choose the type of record that this rule applies to. For example, select Contacts.

    In the Matching Record Type box, choose the type of record to compare. In most cases, you'll probably want to use the same record type for Base Record Type and Matching Record Type. It's also useful to be able to compare different record types. For example, you might want to compare the Email field in Contacts to the Email field in Leads.

    If you want the rule to consider only active records while detecting duplicates, select the Exclude inactive matching records check box. You should also select this check box if your duplicate detection rule criteria are based on a status field.

    Please have a look at below links:

    rocketcrm.co.uk/.../

    www.youtube.com/watch

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans