Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Issue with lead scoring model

(0) ShareShare
ReportReport
Posted on by 90

Hi ,

We have created a lead scoring example with following actions on one field (say Field X) 

1. Field X > 600 : Add score 20

2. Field X <=600 and >300 : Add score 15

3. Field X <= 300 : Add score 10

We find that the scoring is not working expected if the field is modified . For example : 

When record is created with Field X as 500 : Then score is 15 - This is correct. 

When the same record is modified with Field X as 250 : Then score is 25 - This is Wrong. 

It seems that lead scoring rules are just increasing the previous score but not updating it as per criteria. 

Any suggestions on how to handle these situations. Is this a bug in the model ? This is really confusing for our customer. 

Please suggest

  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Issue with lead scoring model

    Hi vijaykiran,

    The whole lead scoring model process is automatic, so even if we delete lead score record, the final score will still be calculated automatically based on all previous operations, that's by design.

    In your scenario, you could create an empty model without control rules, and create a new lead score record, set its parent model and parent lead.

    Then run following javascript on your lead form when record is saved.

    var leadid = Xrm.Page.data.entity.getId().replace('{', '').replace('}', '');
    
    var eva_score = Xrm.Page.getAttribute("new_evaluationscores").getValue();
    
    var lead_score = "";
    
    Xrm.WebApi.retrieveMultipleRecords("msdyncrm_leadscore_v2", "?$filter=_msdyncrm_lead_value eq "   leadid   "").then(
        function success(result) {
            if (result.entities.length > 0) {
                if (eva_score > 600) {
                    lead_score = 20;
                }
                if (eva_score > 300 && eva_score <= 600) {
                    lead_score = 15;
                }
                if (eva_score <= 300) {
                    lead_score = 10;
                }
                alert(lead_score);
                var data = {
                    "msdyncrm_score": lead_score
                }
                Xrm.WebApi.updateRecord("msdyncrm_leadscore_v2", result.entities[0]["msdyncrm_leadscore_v2id"], data).then(
                    function success(result) {
                        console.log("Ok");
                    },
                    function (error) {
                        alert("Error: "   error.message);
                    }
                );
            }
        },
        function (error) {
            alert("Error: "   error.message);
        }
    );
    

    As you see, we'll update the score value manually based on value in field X.

    Once the score field of lead score record reaches threshold, then trigger a workflow to qualify its parent lead.

    In a word, we do sales ready job for lead manually without model.

    Regards,

    Clofly

  • vijaykiran Profile Picture
    vijaykiran 90 on at
    RE: Issue with lead scoring model

    Thanks Clofly . However , I cannot keep stopping the model as these changes can happen multiple times on the field in several records.

    I pull the improvement request in the Idea forum.

    Do you know where else is the score saved on lead form or other entity. I tried to delete the old lead score record when field is modified , expecting that a new lead score record will be created without incrementing old score but it still increments old score.

    Thank you

  • Suggested answer
    cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Issue with lead scoring model

    Hi vijaykiran,

    From 4th tip of this article:

    When your model includes several rules, each rule can affect the lead score independently

    So if your lead status move from "field X equals 500" to "field Y equals 250", then the third rule will be triggered regardless of other rules have been triggered.

    A workaround is that you could stop the model and go live it again, during this period, old lead score records will be cleaned and score will be re-calculated based on current lead fields value once the model goes live again. 

    Lead score of your record will back to 10 if you re-run the model.

    You could request your requirement on improvement of lead scoring model to Ideas forum.

    Regards,

    Clofly

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…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans