Home > Dynamics CRM 2011, Javascript > CRM 2011: Always submit attribute using Javascript setSubmitMode

CRM 2011: Always submit attribute using Javascript setSubmitMode

Making fields read-only is a great way to restrict change or to make sure input is valid. However, all read-only fields are not submitted by default onSave event.

This is not desirable if you are automatically populating fields from user input on another field(s) and those fields cannot be changed by user. Those auto-populated fields will never be saved.

To make sure the fields are saved, we can call javascript function setSubmitMode.

Xrm.Page.getAttribute("<field name>").setSubmitMode("<submit value>");

Submit values available are:

  • always
  • never
  • dirty

Read more on MSDN article.

Cheers – Sy

About these ads
  1. No comments yet.
  1. No trackbacks yet.

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

Follow

Get every new post delivered to your Inbox.

Join 111 other followers

%d bloggers like this: