Today, when I was Testing a feature in the Test Environment, found the below strange error in the Test environment and in the Dev environment there is no such issue in the code.
ReferenceError: Web resource method does not exist: XYZ.Case.OnLoad. However the closest object we found is XYZ.Case that contains these properties: GetEnvironmentVariableValue,SwitchBPF,OnPostSave. Please verify this object is not corrupt and is not an object of the same name defined elsewhere, such as another script.
at y._handleMethodNotExistError (https://Xyz-cep-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:1218209)
at y.execute (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:1216797)
at https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:4:108242
at i (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:102724)
at ne._executeIndividualEvent (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:4:108216)
at ne._executeEventHandler (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:4:105034)
at Object.execute (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:4:102225)
at w._executeSyncAction (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:587365)
at w._executeSync (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:587092)
at w.executeAction (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:586874)
at t.dispatch (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:592211)
at Object.dispatch (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:853204)
at Object.dispatch (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:591700)
at dispatch (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/app.js?v=1.4.6623-2310.3:14:587908)
at Ft (https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/20.js?v=1.4.6623-2310.3:4:55315)
at https://xyz-ce-test.crm6.dynamics.com/uclient/scripts/26.js?v=1.4.6623-2310.3:4:59919
Error Details:
Event Name: onload
Function Name: XYZ.Case.OnLoad
Web Resource Name: xyz_ce/incident.js
Solution Name: XYZBaseSolution
Publisher Name: xyz
I did the below things to troubleshoot this issue,
- Removed the Browser Cache.
- Checked for any Unmanaged layer on the JavaScript, which is causing this issue.
- Checked for any Unmanaged layer on the Case Form, where the code is running.
- Compared the Dev and Test Js Code.
and everything was looking good and nothing changed, but still issue was coming in Test.
Finally, I have opened the Case Form and clicked on the custom method configured on On Load Event, there was strange error message (some out of the box Read error message and some how, this file has corrupted.) and due to this script was not running as expected in the Test environment.
Removed the custom method which was giving the Read error on click of it, configured on On Load. Clicked on Save and Publish.
Added the same method back again to the On Load Event and clicked on Save and Publish, and deleted the browser cache and it started working without any issue.
Only thing to remember is needed to remove the Unmanaged layer on the form in the Test environment, before the next deployment to Test.
Hope you have followed my article and resolved this issue.
Please like and share your valuable feedback on this article and Follow my blog to get my articles to your Inbox.
Below are my earlier articles that you can have a look.
How to Turn Off the Modern Look in the Model Driven Apps?
How to Turn on the New modern, refreshed look for the Model-Driven apps?
Microsoft Power Apps – Apps filter feature
How to Create Microsoft Power Apps 30 days Online Trial Version and an Environment?
Microsoft Power Apps – Solutions filter Preview feature
How to Show the Power Automate complete Expressions?
Power Automate Error: You should specify a contact or account.
How to get the Choice Text and Value in the Dataverse using JavaScript?
Microsoft Dataverse Low Code No Code Plugins
How to convert the Number String to Number Array?
How to Integrate Instant Plugins in the Power Automate Flow?
Power Apps – ‘actionname’ is an unknown or unsupported function in namespace ‘Environment’
Dataverse Browser V1.1.0.1 is available for Dataverse Plugin Debugging
How to Integrate Instant Plugins in the Canvas App?
How to Enable Access to Microsoft Dataverse Actions (Preview feature) in the Power Apps?
How to Create an Instant Plugin in the Dataverse Environment?
How to Install the Microsoft Dataverse Accelerator in the Dataverse Environment?
What is Microsoft Dataverse Accelerator?
How to get the Logged in User Information in the Power Apps?
How to Install Power Platform Tools in Visual Studio Code?
How to Install the Apps from the Microsoft AppSource to your Dataverse Environment?
Microsoft Power Apps Maker Portal has a new look
Microsoft Power Apps Emulator (New Feature)
How to Enable the Dataverse Offline (Experimental Feature) in the Canvas Apps?
How to set the Authoring Version in the Canvas App?
New version of Dataverse Browser is available for Dataverse Plugin Debugging
Latest Free Practice Assessments for Microsoft Certifications
Download CRM 365 V9.X Tools using PowerShell
How to set the Refresh cadence for a Power Platform Environment?
Update forms and views (Preview feature) in Dataverse
How to connect to Microsoft Dataverse in Power Automate Flow using Service principal?
How to Enable Copilot (Preview) feature in Canvas Apps?
How to Debug a Dataverse Plugin without Installing the Profiler in the Plugin Registration Tool?
How to Enable the Licenses (Preview) feature for a Power Platform Environment?
How to Enable Maker Welcome Content (preview) in Power Apps Maker Portal?
How to Enable Managed Environments for a Dataverse Environment?
How to Enable the Modern Controls (Preview feature) in the Canvas Apps?
How to Enable 2023 Release Wave 1 updates in the Dataverse Environment?
How to Deploy Enterprise Applications in the new Dataverse Environment?
What is Preview, Experimental and Retired features in Canvas Apps?
How to Enable the New Power Fx Formula Bar in Power Apps Studio?
Writing Power Fx formulas with natural language
Power Fx Formula Columns in Dataverse
Generating Power Fx formulas from examples
How to Create Dynamics 365 Marketing 30 Days Trial Version Online?
How to disable Multi-Factor Authentication (MFA) on Dynamics 365 Login?
How to Create Microsoft Power Apps 30 days Online Trial Version and an Environment?
How to Update the URL of the Dynamics 365 CE Environment?
Power Apps US Government service URLs
How to Download Microsoft Power Platform Icons?
Microsoft Dataverse and Postman articles
Microsoft Dynamics 365 Online regions list
How to Install, Connect to Microsoft Dataverse and Use XrmToolBox?
How to take the Back-Up of Dynamics 365 Online environment?
How to restore Database Backup in Dynamics 365 Online?
How to recover a deleted Environment in Dynamics 365 CRM Online?