Script Errors Encountered after Field Service Upgrade to 8.x
In one of my projects, I suddenly encountered script errors after upgrading the Field Service solution from version 7.x to 8.x (the latest version). When loading the Quote and Product line item forms, the system shows the following error message:
Upon further investigation, I found that the Display Name of the Quote Library is empty in the Form Properties.
And when I clicked Edit on the Quote.Library.js, the content here is empty too. This is what caused the error message popping up every time the form is loaded.
Solution: As suggested by Microsoft Support engineer, the solution is to
- remove the deprecated/empty library (e.g. msdyn_/Quote/Quote.Library.js)
- add the library found in the Field Service Information Form (i.e. msdyn_/Quote/FieldService.Quote.js)
- Add the event handler with the new Form OnLoad method (e.g. FieldService.Quote.Library.Load) and make sure that Pass execution context as first parameter is checked.
Root Cause: During the Field Service upgrade, the upgrade process removed the old msdyn_/Quote/Quote.Library.js and replaced it with the new msdyn_/Quote/FieldService.Quote.js. But the process can only replace the library and the event handler method in the out-of-the-box Field Service Information forms, not in the custom forms copied from the Field Service Information forms.
Other affected areas
After closing that ticket with Microsoft Support, I realised that the same issue is happening in the Quote Product entity form too. I applied the same solution by checking the Library and Function from Field Service Information form and updated in the custom forms copied from the FS form.
Here is the list of other impacted custom Field Service forms that I had to change. There is no change required in the Field Service forms of Order Product and Opportunity entities.
|Entity||Logical Name||Deprecated Library||Deprecated Function||New Library||New Function|