To facilitate development we setup our development environments in a way which allows us to do most of the coding and testing in Visual Studio in our local machines.
The Visual Studio solution provided with this article demonstrates not just the loading of the webresource but is also configured in a way which allows you to test the process in your development environment and later on deploy it in your crm lab.
Setup Visual Studio for testing crm scripting
In our case our test html page is called CrmTest.html.
You can download these tools from this Google Git repository.
* load resource file
//var JScriptWebResourceUrl = “../WebResources/new_QualTech.CRM.Common.js”;
var JScriptWebResourceUrl = “/Scripts/CrmScripts/QualTech.CRM.Common.js”;
var xmlHttp = new XMLHttpRequest();
xmlHttp.open(“GET”, JScriptWebResourceUrl, false);
The custom script files in Dynamics 365
When we are providing custom development for Dynamics 365 we follow pretty much these same steps as described in this article. It allows us to develop and test the custom functionality completely in our development environment and crm lab before deploying it in the customer’s environment.
The picture above shows the two files we created after uploaded into crm’s web resources. You need to upload these files into your Dynamics 365 lab by selecting Settings>Customize the System. Select Web Resources and click the New button to add the files QualTech.CRM.Common.js and QualTech.CRM.Test.js. Click the Save button and Publish to publish the changes.
To test the changes you now need to open the Account form.
From the top menu select the Sales tile and the Account option. Once the Account grid opens click the New button and you should now see the Hello dialog displayed on the form.
As always I hope you find this article useful. If you have any comments please do so on the article or contact us at email@example.com with any questions.