IntelliSense for Xrm.Page

WRITTEN BY Patrick Verbeeten - 25 September 2010

In CRM 2011 Javascript is no longer embedded in forms but now has build in feature to use external resource files. You can edit these files using the web browser or in an external editor. Visual studio supports Intellisense for JavaScript, this explains how enable the support for the CRM provided objects such as the Xrm.Page object to be shown.

To enable this support Visual Studio needs a reference to base the IntelliSense. First you need to download the reference file XrmPage-vsdoc.js (right click and choose save). Save this file on a convinient location for example a folder named 'IntelliSense'. Now you can create a new js file in Visual Studio then add the following line to the top of this file:

///<reference path="IntelliSense\XrmPage-vsdoc.js"/>

The path to the file can either be relative or absolute, in this example the reference file is placed in a folder named IntelliSense in the folder where the new web resource js file is saved.

I have only tried this file with Visual Studio 2010. If there are any function which are incorrect or other errors please let me know.

This file is also available on https://nuget.org/ and http://crm2011snippets.codeplex.com.


COMMENTS
  • Developer
    King Whitey
    11.07.2012 22:46
    I found that if you have ReSharper installed, you will have to disable it for the intellisense to work properly.
  • CRM Consultant
    Konrad Viltersten
    29.12.2012 11:52
    Are you saying intellisense in general, intellisense for JavaScript or intellisense for this particular VSDOC-file? Also, I'm curious what kind of non-proper behavior that you'e experienced. Is it just some mild glitches or is a full-blown break-down with nothing displaying at all?
Add Comment