web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

MS CRM 365 Online Lead Qualification Question

(0) ShareShare
ReportReport
Posted on by

The business requirement is to create an account on qualification of a lead.

As most people may be aware there has been major changes to the lead qualifications process from 2011 to 365.

After serious thought, I opted to create a pre-validation plugin and then some JavaScript to redirect the user to the newly created account after qualify. This works as a nice end to end solution.

Although slightly different to my requirement, I used the following link to develop my idea- https://www.thrives.be/dynamics-crm/functional/lead-qualification-well-skip-that-opportunity/

This works fantastically well however, ONLY after the first qualify of the day....

On the first qualify, the lead page remains and does not redirect the user, if you click qualify again...an error comes up to say "Already Qualified" and then redirects the user to the account page.

I am guessing this is todo with the JS timeout and the qualify code only waking up for the first time.

Help much appreciated.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     if could be the delay, in which case you might just try to alter the code like this:

    var refreshCounter = 0;

    function OpenAfterRefresh()

    {

        Xrm.Page.data.refresh(false).then(function () {

                       var contactId = Xrm.Page.getAttribute("parentcontactid").getValue();

                       if (contactId != null && contactId.length > 0) {

                           Xrm.Utility.openEntityForm(contactId[0].entityType, contactId[0].id)

                       }

                       else{

                          refreshCounter++;

                          if(refreshCounter < 10) setTimeout(function () {

                                                                      OpenAfterRefresh();

                                                                }, 500);

                       }

                   }, function (error) { console.log(error) });;

    }

    function RefreshOnQualify(eventContext) {

       if (eventContext != null && eventContext.getEventArgs() != null) {

           if (eventContext.getEventArgs().getSaveMode() == 16) {

             refreshCounter = 0;

             setTimeout(function () {

                   OpenAfterRefresh();

               }, 500);

           }

       }

    }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans