Use XRM type definition in your Javascript file
We implement Javascript webresource for form scripting (form onload, field on change,...). Our code need to follow the official documentĀ Xrm object, execution context, form context,..
Javascript is not a strong type programing language, we don't haveĀ suggession/intellisense like C#, Typescript
In this article, I will show you how to get suggession/intellisense for your JS code
Step 1: Download the file xrm type definition here
Save it to a folder, for example Types\xrm.d.ts
Step 2. Add this line to the top of the JS file that you want to have intellisense
///
Ā
Step 3: Add type annotation for function param
Ā
Step 4. Enjoy the magic
You will have suggestions while typing like this
Ā
It also shows suggestions for Xrm.WebApi
That's all. Hope this help you.
Ā
Published on:
Learn moreWe can help you with Use XRM type definition in your Javascript file
If you want help implementing, troubleshooting, or improving this product, contact us and weāll point you in the right direction.