Time to refresh some knowledge:

I had been using window.open for opening a dialog from CRM ribbon button for quite sometime. And strangely enough, I never got a chance to do this from Outlook!

(Maybe the reason was that this dialog was used for devlepors only. And you know, we developrs prefer web client more for our day to day CRM adventures.)

But anyways, did that in Outlook and it prompted for credentials.

I was using Xrm.Page.context.getClientUrl() method.

(Remember Xrm.Page.context.getServerUrl() is deprecated and should be replaced with getclienturl).

Some digging around and I found this from MSDN :


Returns the base URL that was used to access the application.

This method is new in Microsoft Dynamics CRM 2011 Update Rollup 12 and the Microsoft Dynamics CRM December 2012 Service Update.

The values returned will resemble those listed in the following table.

Client Value
Microsoft Dynamics CRM (on-premises) http(s)://server/org
Microsoft Dynamics CRM Online https://org.crm.dynamics.com
Microsoft Dynamics CRM for Outlook with Offline Access when offline http://localhost:2525
Return Value
Type: String

 As my setup is an IFD implementation, getClientURl() on outlook returned me path of my ADFS server where Security Token service is installed.

I searched internet a bit and found that there is a workaround:

if (Xrm.Page.context.isOutlookClient()) {
openStdWin(url, ‘Name of Window’,width, height, additionalproperties);
window.open(url, ‘Name of Window’, ‘status=no, width=’ + width + ‘,height=’ + height + ‘,top=’ + posTop + ‘,left=’ +
posLeft + ‘,scrollbars=no,toolbars=no,menubar=no,location=no, align=center,resizable’);

Hope this helps someone !


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s