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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Error on qualifying a Lead - Cannot read property 'setValue' of null

(0) ShareShare
ReportReport
Posted on by 5

On qualifying a lead to a case, information is copied to the Contact and the Case. But every time I qualify, I get this error: Cannot read property 'setValue' of null.  It's strange as the case is created and the updates are there, however, I suspect that one of the fields is not actually being set or updated.  How can I find out what field this is?  The error log is as follows:

TypeError: Cannot read property 'setValue' of null
at Object.success (crm.harboursport.co.nz/.../hs_ReferralJSLibrary
at o (crm.harboursport.co.nz/.../hs_jQueryLib
at Object.fireWith [as resolveWith] (crm.harboursport.co.nz/.../hs_jQueryLib
at w (crm.harboursport.co.nz/.../hs_jQueryLib
at d (crm.harboursport.co.nz/.../hs_jQueryLib
at Object.send (crm.harboursport.co.nz/.../hs_jQueryLib
at Function.ajax (crm.harboursport.co.nz/.../hs_jQueryLib
at ShowSelectedContactDetails (crm.harboursport.co.nz/.../hs_ReferralJSLibrary
at eval (eval at RunHandlerInternal (crm.harboursport.co.nz/.../ClientApiWrapper.aspx, <anonymous>:1:1)
at RunHandlerInternal (https://crm.harboursport.co.nz/form/ClientApiWrapper.aspx?ver=-904332278:157:1)

Thank you!

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    According to the error description, you have an issue with your code. You will have to troubleshoot it. Check my video on how you can do it:

    www.youtube.com/watch

  • Esteban Coto Alfaro Profile Picture
    on at

    Hello, I recommend to add a debugger inside the function so you can figure out which field is throwing the error.

    Thanks!

    Community Support Team - Esteban

    If this Post helps, then please consider Accept as solution to help the other members find it more quickly.

  • necsa Profile Picture
    3,455 on at

    Hi,

    I think the field is not on the Form.

  • Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    Hi,

    Below is the possible reasons :-

    1. The Field which you are referring on the Lead form is not present on the lead form itself. That means in source it self will have value as null and when you trying to set that value on designated fields then you will get the Null error.

    2. The field which you are trying to set on the form is not present on the form.

    3. It is possible that you have provided wrong "Schema name" of that field which you are trying to Get or Set.

    stackoverflow.com/.../weird-error-typeerror-cannot-read-property-setvalue-of-null-at-onsuccessmapun

  • Harbour Profile Picture
    5 on at

    Thank you for your explanations and yes that makes total sense.  I am however trying to figure out what field it is on the destination that is missing on the lead form... how can I check this?

  • Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    Yup you can easily check by debugging your code.

    Please refer below link where you will find the steps to debug JavaScript code.

    carldesouza.com/.../

    Also one suggestion please always check if your source field is null or not. if it is not null then set the value to destination field.

    carldesouza.com/.../

    Please verify this answer if you will able to resolve this issue.

    Thank you,

    Amit Katariya

  • Suggested answer
    Timothy Bohte Profile Picture
    44 on at

    Hi,

    When qualifying a lead, the system will try to create three records, an opportunity, account and contact. Check if there are any mandatory collums in those tables that are not present or mandatory on the lead form.

    Regards,

    Timothy 

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans