Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Javascript Onload Errors on Case Record

(0) ShareShare
ReportReport
Posted on by

Hey everyone, 

I am running into an issue - I have a single web resource containing multiple JS functions that run on the Case record. Multiple functions are running onload and some of them are also tied to the OnChange event for specific Case fields. I have tested each function and they work as intended. What's weird is that sometimes when I load an existing Case record, I will get an error on every single function running OnLoad and I need to click Ok on each one before I can see the Case record. When I refresh that same Case record, I notice that there are no errors that show up. The error is below:

pastedimage1635012724198v1.png

The error doesn't seem to make sense because it only happens occasionally and randomly, it's not like a consistent error. Any advice as to why its appearing? Thanks!

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Javascript Onload Errors on Case Record

    Hi Ras13j,

    Usually, this error is caused by something like this line formContext.getAttribute("field name").getValue(); when your field name is wrong or the field doesn't exist on this form.

    You could debug the code in the function which is referred in the screenshot. If you make sure the code is correct and you didn't get any error in the console tab when you press F12, clear the cache of browser and then open that case record to have a try again.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#2
Ramesh Kumar Profile Picture

Ramesh Kumar 42

#3
David Shaw_UK Profile Picture

David Shaw_UK 27

Featured topics

Product updates

Dynamics 365 release plans