
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:
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!
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.