Recently we started getting the below error on the form load of the Work Order Service Task record, that also only in specific environments, and there was no changes made there.
Error Details: Event Name: onload Function Name: OnLoad Web Resource Name: msdyn_/WorkOrderServiceTask/WorkOrderServiceTask.js Solution Name: msdyn_FieldService_patch_update Publisher Name: microsoftdynamics
From the error message also it was clear it was the error in the out-of-the-box javascript.
On raising the Microsoft Support Ticket, we were immediately informed that it was because of a change in the function definitions in the .js files along with its associated handlers which was done to prevent object definition collisions in the web resources.
This applied to forms of the below tables
- Work Order (msdyn_workorder)
- Work Order Service Task (msdyn_workorderservicetask)
- Work Order Product (msdyn_workorderproduct)
- Work Order Service (msdyn_workorderservice)
- Knowledge Article (knowledgearticle)
And below are the changes required to be done.
- Work Order (msdyn_workorder)
- Library value: msdyn_/WorkOrder/WorkOrderExperience.Library.js
EITHER:- Incorrect function: onLoadLightForm
- Correct function: WorkOrderExperience.Library.onLoadLightForm
OR - Incorrect function: onLoad
- Correct function: WorkOrderExperience.Library.onLoad
- Library value: msdyn_/WorkOrder/WorkOrderExperience.Library.js
- Work Order Service Task (msdyn_workorderservicetask)
- Incorrect
- Library value: msdyn_/WorkOrderServiceTask/WorkOrderServiceTask.js
- Function value: OnLoad
- Correct
- Library value: msdyn_/WorkOrderServiceTask/WorkOrderServiceTaskGrid.js
- Function value: WorkOrderServiceTaskGrid.OnLoad
- Incorrect
Work Order Product (msdyn_workorderproduct)
- Library: msdyn_/WorkOrderProduct/WorkOrderProductGrid.js
- Incorrect function: OnLoad
- Correct function: WorkOrderProductGrid.OnLoad
Work Order Service (msdyn_workorderservice)
- Library: msdyn_/WorkOrderService/WorkOrderServiceGrid.js
- Incorrect function: OnLoad
- Correct function: WorkOrderServiceGrid.OnLoad
- Library: msdyn_/KnowledgeArticle/KnowledgeArticleWorkOrderRelationship.js
- Incorrect function: OnSave
- Correct function: KnowledgeArticleWorkOrderRelationship.OnSave
We applied the change to the other forms also, which fixed the error for us.
Hope it helps..
One thought on “Fixed – Web resource method does not exist: OnLoad error in Work Order, Work Order Service task, and other forms in Dynamics 365 Field Service”