Loading...

CHECKING DIRTY FIELDS IN DYNAMICS 365 USING JAVASCRIPT

CHECKING DIRTY FIELDS IN DYNAMICS 365 USING JAVASCRIPT

In Dynamics 365, it is crucial to know which fields have been modified on the form during an update. While creating a plugin to receive data of the modified fields on the current update event is one solution, this tutorial shows you how to identify the modified fields through JavaScript. The trick is to check if the form or fields are in a dirty state, which signifies if they've been changed.

The tutorial outlines three methods to identify if the form or specific fields are dirty, including:
  1. Checking if the form is dirty to verify if any field on the form has been modified by using the function getIsDirty. This function will return true if the form is dirty, false if not.
  2. Checking if a field is dirty to verify if a specific field on the form has been changed by using the function getAttribute("schema-field-name").getIsDirty(). This function will return true if the field is dirty, and false otherwise.
  3. Displaying all the modified fields to verify what fields on the form have been changed. This is done by using the function getDataXml(), which will return the list of attributes that have been modified on the form with the values of each field. This function generates an XML result indicating the entity logical name and the logical name of each field, complete with their current values.

The article concludes by emphasizing the importance of these methods for Dynamics 365 developers and hopes that the information provided helps them in identifying dirty fields in Dynamics 365.

Link: https://charlesabikhirs.blogspot.com/2023/03/checking-dirty-fields-in-dynamics-365.html

Published on:

Learn more
Dynamics 365 Education and Knowledge
Dynamics 365 Education and Knowledge

Share post:

Related posts

Fixed – The latitude or longitude for the User record associated with this resource is invalid – Dynamics 365 Field Service /Dataverse

While trying to set the Start Location / End location to the Resource Address for Bookable Resource, we might get the below error Exception Me...

42 minutes ago

Share A Model-Driven App With An Entra Security Group

Sharing a model-driven app with an Entra security group has never been easier. Not only can you add a user to the group, but you can also gran...

1 day ago

How the “Regarding” field works in Microsoft Dynamics 365 CRM and the process for adding a custom entity to the “Regarding” lookup field.

Microsoft Dynamics 365 CRM is a powerful tool that allows you to associate records with other entities through the use of the "Regarding" fiel...

2 days ago

Improve Marketing and Sales Collaboration | Connect Mailchimp with Dynamics 365 CRM webinar

If you're looking to improve marketing and sales collaboration, syncing Mailchimp data with Dynamics 365 CRM is a crucial step. Doing so will ...

3 days ago

Customize Model-driven App Header Colors | Step-by-Step Guide

If you want to customize the header colors of your Model-driven app beyond the default settings, this tutorial is for you. It provides step-by...

3 days ago

Enabling fast, flexible, cost-effective service with Microsoft Copilot in Dynamics 365 Field Service

Microsoft Dynamics 365 Field Service has introduced Copilot capabilities that provide field service managers with an AI-powered assistant. By ...

4 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy