Wednesday 22 November 2017

CRM Portal - Validate that Email already exists when using "Forgot Password"

Hello Everyone,

I have been seen a lot of people were asking about 'Forget Password' strange behavior in CRM Portal.

CRM Portal provides Forget Password option like other portal or websites, that allows users to reset their password if they have either forgotten their password or triggered an intruder lockout to authenticate with an alternate factor and repair their own problem, without calling the help desk.

CRM Portal ask the user to enter an email address in order to send password reset link. But it does not check whether email exists in CRM or for duplicate contact of same email address.

You either get an error message or not receive the email due to following reasons :
  1. If multiple contacts found of same email address in CRM.
  2. If the entered email address does not exist in CRM.
  3. Is the email address written correctly in the contact and on the password reset control?
Although people have posted this in Microsoft Dynamics 365 Ideas Portal (here), but not sure whether this would be included in the future release or not. 

Solution 1 -


Enable duplicate detection rule in CRM and create a new rule to warn users to not create duplicate contact of same email address. But by doing this, you can only warn or give a message to the user but cannot restrict from contact creation of same email address.

Also, by doing this you can only check for duplicate contacts of same email address, not whether the user exists or not.

Solution 2 -


Create a new Content Snippet record


Name - Account/ForgotPassword/PageCopy
Website - <website name>
Value - text


Hide, out of box Send button and create your own custom button


$(window).load(function() {

$('#submit-forgot-password').hide();

$('#submit-forgot-password').after('<input type="button" value="Send" id="checkemailId">');

// You can apply the CSS as well on the button by adding a Style tag to it.

});

Write OData query to check for duplicate contacts of same email address and to check whether email id exists in CRM or not.


Refer below article if you are not aware how to use the OData in Portal.

http://arpitmscrmhunt.blogspot.in/2016/12/adxstudio-portal-how-to-use-odata.html


Put it inside the window.load function.

$('#checkemailId').click(function () {

var inputEmailAddres = $("#Email").val();

var odataurl= "~/_odata/contacts?$filter=emailaddress1%20eq%20%27" + inputEmailAddres + "%27%20or%20emailaddress2%20eq%20%27" + inputEmailAddres + "%27";

            $.ajax({
                type: "GET",
                url: odataurl,
                dataType: 'json'
            }).done(function (json) {

                 var contactsColl = json.value;

                 // If multiple email id found
                if (contactsColl.length > 1)
                {
                     alert("Multiple Contact Foundof entered email address");
                }
                 // If Single email id found
if (contactsColl.length == 1)
                {
                   $('#checkemailId').val('Sending...');
                    $('#submit-forgot-password').click();
                }
                // If email id not found
if (contactsColl.length == 0)
                {
                     alert("Entered Email Id does not exist in system");
                }

            })
});

7 comments:

  1. At present writeup, we will deal in detail with the AOL mail service. AOL mail is a free web-based email service that is provided by AOL. AOL mail is one of the most popular to provide the best email services and media in this technology world.
    It may be possible that sometimes you get an error like the AOL mail login issue with the AOL account. Almost time the problem report is AOL email sign in.

    ReplyDelete
  2. is this gonna work if we want to check duplicate detection through multiple fields in CRM portal?

    ReplyDelete
    Replies
    1. Yeah. You need to change your Odata Query conditions accordingly.

      Delete
  3. It is working Arpit bro , but process is not triggering please provide me any suggestions on this

    ReplyDelete
  4. Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to

    (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time.

    Contact him now and thank me later.

    ReplyDelete
  5. Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to

    (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time.

    Contact him now and thank me later.

    ReplyDelete

Blogger Widgets