How to get Form Type using JavaScript in CRM 2011


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!

**For CRM 2011 Training, please check out our CRM Training page. Please share |Like in Facebook if you feel like this page is useful.

About Dynamics CRM Guru

We are a group of CRM Consultants and have experience in all Microsoft CRM versions. Currently we provide training in Microsoft CRM 2011. Write to us if you are looking for a training in CRM 2011, Email: stepforit@gmail.com

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:

WordPress.com Logo

You are commenting using your WordPress.com 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: