How to get Form Type using JavaScript in CRM 2011

Top_bottom banner


Get Form type using javascript in CRM 2011 :

When you write Java script/Jscript code on CRM forms, there will be situations where you need to trigger the script only on certain forms. This is how we get the Form Type.
In CRM 2011, there are 7 types of forms are defined.
0 – undefined
1 – Create
2 – Update
3 – Read Only
4 – Disabled
5 – Quick Create (Deprecated)
6 – Bulk Edit
The below script checks the form type and alert if the form type is of ‘Create’ form.
//Get form type
var CREATE_FORM = 1;
var type = Xrm.Page.ui.getFormType();
if(type = CREATE_FORM)
alert(“This is Create Form”);
Hope this helps!

Please share |Like in Facebook if you feel like this page is useful.

Top_bottom banner


About Dynamics CRM Guru

We are a group of CRM Consultants and have rich experience in all Microsoft CRM versions. Currently we provide training in Microsoft CRM 2015/CRM 2013 and CRM 2011.

Posted on March 12, 2013, in CRM 2011 JScript, Microsoft CRM 2011, MS CRM 2011 Training and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: