Centralized, global Script Libraries allowed in MS CRM 2011

September 28, 2010 by Geron Profet · Leave a Comment 

Microsoft Dynamics CRM 2011 now supports common JavaScript libraries that can be called from any entity.  This makes it easier to upgrade your create centralized JavaScript files with functions you frequently  use. In CRM 2011 these common JavaScript libraries are called Web Resources.

js2

MVP Ayaz Ahmad has recently posted a detailed look at how to use jscript libraries in CRM 2011, with screenshots.

In Microsoft Dynamics CRM 4, it is a very tedious task for system customizers to manage and track JavaScript. System Customizers/Developers have to write JavaScript on every event handler on the form. But Microsoft Dynamics CRM 2011 provides JavaScript libraries that can be utilized on events and forms across the solution. Now common JavaScript functions can be written at one centralized JavaScript file and utilized across solution.

Moreover, multiple JavaScript libraries can be created. For example, one common library for general CRM Service calls and one common library for UI manipulation and so on.

Read the rest of the post at Ayaz' blog.

Global variables in MS CRM 4.0

April 24, 2010 by Geron Profet · Leave a Comment 

Global variables provide information about the Microsoft Dynamics CRM deployment and options chose by the user. These variables are accessible on any form.

The following table shows the available global variables:

SERVER_URL:
Provides a string that represents the base server URL. When a user is offline, the SERVER_URL points to the local Microsoft Dynamics CRM Web services.

USER_LANGUAGE_CODE:
Provides an LCID value representing the Microsoft Dynamics CRM Language Pack that the user has chosen

ORG_LANGUAGE_CODE:
Provides an LCID value representing the Microsoft Dynamics CRM Language Pack that is the base language for the organization

ORG_UNIQUE_NAME:
Provides the unique text value of the organizations name.

Example:

alert("SERVER_URL="+SERVER_URL );  
alert("USER_LANGUAGE_CODE="+USER_LANGUAGE_CODE);  
alert("ORG_LANGUAGE_CODE="+ORG_LANGUAGE_CODE);  
alert("ORG_UNIQUE_NAME="+ORG_UNIQUE_NAME);