Lately, I’m still preparing my presentation for Reactor Indonesia with the topic “Membangun Solusi Low-Code Dengan Power Platform” and when I’m stumbled to create the WebResource, I remembered about Dataverse DevTools by Danish Naglekar that already being installed in my VS Code for so long since he published the tool but I had never tried it. Looking at the GitHub page it’s already being evolved and makes me want to try it 🤣 (sorry Danish took it so long!). Without further ado, let’s begin!
You need the below software installed before you begin:
Open your Visual Code > go to the Gear icon > Extensions > search “Dataverse DevTools” > Install the extension:
Create Dataverse Connection
Once you have installed it, you will have the Dataverse Icon in your VS Code and you can go to the next steps:
To connect to your dev environment, you need to add a new connection > paste your organization URL (for instance https://yourcrmurl.crm5.dynamics.com) > then it will come out the new dialog on top of your VS Code to select how to log in > for this demonstration, I’ll choose Username & Password > input your username > input your password > named the connection > select the type of the environment (suppose you always choose Dev. But I know some people directly update to other instances type 🤣) and you are ready to go!
Prepare The Project Source Code
Once you click that, it will ask the template that you want to be generated > choose WebPack > it will ask the namespace (THIS IS IMPORTANT WHEN YOU WANT TO REGISTER THE FUNCTION):
After you give the namespace name, it will automatically run the “npm install” command and you just need to wait until it finishes.
Let’s Begin The Customization!
To begin the customization, I’ll generate the typings which is one of the features of this project. The typings in short are the definition of the form. So IntelliSense will automatically understand what you want to type when you create the customization later.
Go to the Dataverse DevTools icon >on the Entities tab you can find the entity that you want to be generated > right click on the entity and select “Generate Typing” > select the directory which in this case I’ll put it in “typings” folder:
Go to your Explorer tab > in the typings folder will have the generated file:
Next, in the terminal, you can run “npm run build” > select the src folder and right click here > click “Add Dataverse TS File” > it will open a dialog to give the name of the file and you are ready to develop the customization!
Once your customization is done, you need to run “npm run build” which will generate the js files in the “WebResources/scripts” folder:
So, next time you got changes. You only need to run “npm run build” > then right-click on the WebReources/script/[your-js].js > Upload & Publish Web Resource:
Last part, if you have multiple JS files that you want to be updated > go to the Dataverse DevTools > on the Web Resources tab/pane >click Smart Match (light bulb icon)> You can just click “Upload All Linked“:
3 thoughts on “Let’s try Dataverse DevTools to easily create/update WebResource customizations!”
Hello!, guys! I have a question.
I created a new webresource in site. Now I’d like to link it with my local copy in VS Code.
How can I refresh the list of webrosources to link local copy with copy at the Cloud?
Hi, I think you can use XrmToolBox > https://www.xrmtoolbox.com/plugins/MsCrmTools.WebResourcesManager/ to download it to your local folder.