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

Announcements

News and Announcements icon
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!

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
KristineRisberg Profile Picture

KristineRisberg 37

#2
11manish Profile Picture

11manish 31

#3
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 21 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans