Tue, 01/27/2026 - 13:12 By Nguyen Van Hao Contributor Lloyd Sebag

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

/// <reference path="../Types/xrm.d.ts" />

 

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.