Get Form types and modes in Dynamics CRM 2013

getSaveMode(), returns a value indicating how the save event was initiated by the user. The following table describes the supported values returned to detect different ways entity records may be saved by the user in CRM 2013.

execObj.getEventArgs().getSaveMode();
Event Mode Value
Save 1
Save and Close 2
Deactivate 5
Reactivate 6
Send (Email) 7
Disqualify (Lead) 15
Qualify (Lead) 16
Assign (user or team owned entities) 47
Save as Completed (Activities) 58
Save and New 59
AutoSave 70

getFormType(): Method to get the form context for the record. The following table lists the form types that correspond to the return value.

Xrm.Page.ui.getFormType();
Form Type Value
Undefined 0
Create 1
Update 2
Read Only 3
Disabled 4
Quick Create 5
Bulk Edit 6
Read Optimized 11
Advertisements

2 thoughts on “Get Form types and modes in Dynamics CRM 2013

  1. Xrm.Page.ui.getFormType() = 1 even for Quick Create form, Is this a bug or desired behaviour? I was expecting 5..

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