[Resolved] Web Resource Method Does Not Exist in Dynamics 365 CE JS

Microsoft Dynamic 365

Recently, when I was opening a Case record and on onload, I got the below error message.

Script error

One of the scripts for this record has caused an error.

For more details, download the log file.

Web resource method does not exist: executeOnload.

  • Session Id: 9764c944-5ec7-4ebc-bf6e-abd3219357ce
  • Correlation Id: e59c7251-b39b-44bb-b642-f714de31eb25
  • Event Name: onload
  • Function Name: executeOnload
  • Web Resource Name: xyz_/ABCD/Incident/JavaScript/Incident.js
  • Solution Name: Active
  • Publisher Name: DefaultPublisheroperationsxyzd365dev
  • Time: Fri Feb 16 2024 15:57:53 GMT+1100 (Australian Eastern Daylight Time)

Some issue was there on executeOnload or before to that code.

Followed the below steps to resolve the issue.

  1. I opened the JS code.
  2. Copied and pasted the entire code in the Visual Studio and verified all the code.
  3. I did not see any issue in the code and also nothing has shown by the VS as well.
  4. Cleared the browser cache to get the latest code from the server.
    Note: Follow this article to clear the cache from the browser.
  5. After clearing the browser cache as well, the same issue.
  6. Opened the Browser Dev Tools and opened the JavaScript file, which was giving that issue, and observed that code color was changed (yellow to white) from 21st Line as shown in the below image and observed that there was syntax error, instead of = (equals), I need to place : (colon) in 2 places in the code.
    Unfortunately, I did not see this error in the Visual Studio ??
  7. Saved and published the JS code correctly now in the Dynamics 365 CE environment and it started working.

JS Code

Hope you had understood, how to resolve such issues in the JavaScript.

Please like and share your valuable feedback on this blog post.