Dynamics CRM – Javascript Xrm.Page.ui.getFormType()

There are hundreds of blogs which show you this:

Form Type Value
Undefined 0
Create 1
Update 2
Read Only 3
Disabled 4
Quick Create 5
Bulk Edit 6
Read Optimized 11

And then just tell you to use Xrm.Page.ui.getFormType(); to pull the record, but none show any functioning JS. Simple, but works. Nice to have a little example.

This is a bastardization of the code used in my last post, but you get the picture. Set a variable to get the form type, do a check on the form type, do stuff depending on the form type.

I get the form type, I specifically want to target a specific form on create, I then update the form.

 

Jason
Jason
I do things in the clloouuudddd