Home › Dynamics 365 Customer Engagement (CRM) › Dynamics 365 – setSubmitMode in JavaScript
Dynamics 365 Customer Engagement (CRM) · Apr 23, 2018

Dynamics 365 – setSubmitMode in JavaScript

In Dynamics 365, setSubmitMode allows you to define for a field whether it is saved to the database.

For example, let’s say on the Account we do not want the Phone field saved when the user presses save on the form. To do this, we can create a web resource and add it to the OnLoad event of the Account form.

Note there are 3 options:

  • never
  • always
  • isdirty

We will set the field to “never”:

function OnLoad()) {
   Xrm.Page.getAttribute("telephone1").setSubmitMode("never");
}

Enter a new account and enter a phone number:

Click Save. After saving, the screen will refresh and the field will show as blank, i.e. not saved:

For more information: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/attributes/setsubmitmode

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.