Improved typings in Dataverse DevTools

Danish NaglekarDyn365CE6 hours ago5 Views

One of my colleague at EY reached out stating that he would like to use the typings generated by the Dataverse DevTools (DVDT) like Early Bound Generator for C# but in TypeScript. For example,

const fetchAccount: string = `<fetch version="1.0">
                                <entity name="account">
                                   <attribute name="accountid" />
                                   <attribute name="telephone1" />
                                </entity>
                               </fetch>`;

As the team was already using Dataverse DevTools that simplifies working with TypeScript/JavaScript and uploading the web resources to Dataverse; he wanted to continue to use the same tool and was looking for an improved typings instead of the one that Dataverse DevTools already generated.

If you aren’t aware what existed you can generate typings for a specific entity that allows you to use @types/xrm npm package and the typings generated by Dataverse DevTools extends the usage where you get the types based on the attribute you have selected. For example,

const formContext: Xrm.Account = executionContext.getFormContext();

//renders methods associated to number as data type of telephone1 is number
formContext.getAttribute("telephone1").getValue(); 

//renders methods associated to optionset based on the data type of the attribute
formContext.getAttribute("statuscode").getOptions();

So I extended the typings generated by Dataverse DevTools to also now include typings for attributes and entity logical name. Below is the example of how you can use it for getting the attribute names and entity logical name if you want to use it in Fetch XML.

Steps are easy as well,

  1. Open Dataverse DevTools in VS Code
  2. Connect to your environment, this will load all the entities and web resources
  3. Right click on the entity name and click “Generate Typings”

That’s it!!

Hope you enjoy this version. If you have any issues or feature request please log it on GitHub repo.

Original Post https://powermaverick.dev/2025/03/15/improved-typings-in-dataverse-devtools/

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
March 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31       
« Feb   Apr »
Follow
Sign In/Sign Up Sidebar Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...