Posts Tagged ‘webresource’

Xrm.Utility functions to open Entity forms or Web resources

November 1, 2012 1 comment

In CRM, we can open the entity forms using “” method

  • With UR 8, a couple new client-side JavaScript functions were added to open entity forms and web resources
  • These functions fixes the prompt the user to login again issue when you use “” to open form or web resource from CRM online/Outlook client


The Xrm.Utility object provides a container for useful functions. Following MSDN blog which talks extensively on the same

For quick glance below are few samples

Open a new “Account” record form

Xrm.Utility.openEntityForm(“account”); // Pass ‘Account’ schema name

Open an existing “Account” record form

Xrm.Utility.openEntityForm(“account”,”A85C0252-DF8B-E111-997C-00155D8A8410″); // Pass ‘Account’ schema name & GUID

Open a new “Account” record form and setting default values

var parameters = {};

parameters[“formid”] = “b053a39a-041a-4356-acef-ddf00182762b”;

parameters[“name”] = “Test”;

parameters[“telephone1”] = “(425) 555-1234”;

Xrm.Utility.openEntityForm(“account”, null, parameters);

Open an HTML web resource named “new_webResource.htm”



Loading dependent jscript libraries in ribbon button’s execution CRM 2011


I have a ribbon button on my “Account” main grid .

I am calling function “sayHello” which is in my web resource “account_ribbon” by defining custom action like below.


<JavaScriptFunction Library=”$webresource:account_ribbon” FunctionName=”sayHello”>



Now the problem is, I need to call another method from my “sayHello” function, which is in other web resource “common”.

Solution :-

The solution is simple. We can add all the required libraries to <Actions> node like below

 <JavaScriptFunction Library=”$webresource:common” FunctionName=”isNaN” />

Note – Since <JavaScriptFunction> requires a function name, pass “isNaN”.

Now my <Actions> node look like below


<JavaScriptFunction Library=”$webresource:account_ribbon” FunctionName=”sayHello”>


<JavaScriptFunction Library=”$webresource:common” FunctionName=”isNaN”>