Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Why am I getting this error?

(0) ShareShare
ReportReport
Posted on by 80

I have a form with employee name. The requirement is to auto populate the email id when employee name is selected. When removing the employee name an error message is showing.

How to remove this?

Can someone help me with this error?

Cannot read properties of null (reading '0')

TIA

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: Why am I getting this error?

    HI,

    I'm Glad that it worked.

    Please mark my answer verified by clicking on yes under Did this answer your question?

    8750.PNG

  • Learning_D365CRM Profile Picture
    Learning_D365CRM 80 on at
    RE: Why am I getting this error?

    Thank you Arshad

  • Learning_D365CRM Profile Picture
    Learning_D365CRM 80 on at
    RE: Why am I getting this error?

    Thank you Bipin kumar.

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: Why am I getting this error?

    Hi,

    Could you please share the JS code you have on Employee Name change?

    I am suspecting you code is missing null check.

    You should add check condition in your JS as below -

    if(formContext.getAttribute("new_employeename").getValue()!=null)

    {

      var employeeName=formContext.getAttribute("new_employeename").getValue();

    }

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Suggested answer
    RE: Why am I getting this error?

    Hi,

    Check whether your fields are added in your form or not. This error is come generally when your form not contain specific field on which your are written js.

    But you can achieve your requirement using business rule.

    juniorcrmblog.blogspot.com/

    juniorcrmblog.blogspot.com/.../ms-dynamic-crm-interview-question-for-2.html

    all interview question of dynamic CRM.

    Thanks,

    Arshad

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans