CRM 2015 SDK: How to recognize user’s form factor and client

When you’re working on multi-device projects in Dynamics CRM, sometimes you need to know the form factor that the user is currently using in order to execute or note some UI actions using Javascript. Dynamics CRM 2015 makes it easier and suggests using the context object with getFormFactor() method that returns an integer between 0 and 3.

Javascript Code: Xrm.Page.context.client.getFormFactor()

Return Value Form Factor
0 Unknown
1 Desktop (Warning that does not mean Computer, it can also be a desktop version used from a tablet navigator)
2 Tablet Application
3 Phone Application

Let’s apply this to a simple example, we will run an alert box containing the name of the form factor on form loading:

Javascript Code: function myTestFunction()


var formFactor = Xrm.Page.context.client.getFormFactor();

if(formFactor == ‘1’) { alert(“Desktop”);}
else if (formFactor == ‘2’) { alert (“Tablet App”); }
else if (formFactor ==’3′) { alert (“Phone App”); }
else { alert (“Unknown form factor”); }


To get which client the script is executing in, you can use:


Javascript Code: Xrm.Page.context.client.getClient()

The return value of this method is a String. These are the returned values:

Client Value
Browser Web
Outlook Outlook
Mobile Mobile


For more client-side context methods, you can visit







CRM 2015: Yes you can clear a field with Business Rules

If you have experienced Business Rules in Dynamics CRM 2013 you probably had to build a BR where a field must be cleared. Well that was not possible and we used to either make a two lines script or create another hidden field which is always empty and match the field you want to clear to that one. Fortunately CRM 2015 came with a new update making it possible when choosing a field’s value as you can see in this screenshot.


clear br





Dynamics CRM 2015 Update 1 – How to create a theme

CRM 2015 latest update has changed several issues regarding User Interface and made navigation easier with less scrollings and less clicks. Navigating in CRM 2015 now follows the same principles as Microsoft Dynamics Marketing. Check out this video to have further information about navigation and other features regarding Update 1.

Let’s have a glance to a new feature of this last update (UPDATE 1): Creating themes!

A theme is a set of customizations of the graphic interface that you can change to make it fit your corporate visual identity.

So let’s create our first theme, navigate to Settings/Themes then click +New

Note that you’ll use hex codes for your theme colors, here is a link that generates a hex code for every color selected


settings customizations themes create new theme



The three main parameters (I mean those that you will see all the time when navigating) are the logo, navigation bar color and navigation bar shelf color. Here is a screenshot that explains correspondence between colors and items of navigation.

Note that the logo can make max to 400*50 pixels




You can also try to test other UI elements by picking other colors.


ui elements



Hope you’ll like it!









Dynamics CRM 2015 Spring Release is here !

Here are the latest news about CRM 2015 ! Microsoft is launching soon the spring release. This new update will enhance the user experience by making the navigation easier, make it possible to generate leads from social posts, and the most important feature is the new CRM for phones app!

Here is a video of a quick navigation tour :




More details here:






Dynamics CRM 2015 : Available Exams and Certificates

Dynamics CRM 2015 exams can already be scheduled and taken! Note that a free second shot is given for all subscriptions until May 31st 2015!

In addition to the CRM existing certifications, you can also get certified in Microsoft Dynamics Marketing. Here are all the available certifications:


Exam Name Exam Reference
Microsoft Dynamics CRM 2013 Applications
Extending Microsoft Dynamics CRM 2013
Microsoft Dynamics CRM 2013 Deployment
Microsoft Dynamics CRM 2013 Customization and Configuration
Microsoft Dynamics CRM Application
Microsoft Dynamics CRM Online Deployment
Microsoft Dynamics CRM Customization and Configuration
Microsoft Dynamics CRM Installation
Functional Application in Microsoft Dynamics Marketing


More information in Microsoft Official Web Site: