We will learn and understand different record Save Modes in Dynamics 365 CRM. Before we start, make sure to subscribe to CRM Crate so that you stay up to date in the field of Dynamics 365.
Saving a record / row in Dynamics 365 CRM
In Dynamics 365 Customer Engagement, a record is a complete unit of information. Think of it like a single row in a table, with multiple columns, also known as fields, to store the pieces of info that make up the entire row.
The user can create or update a record by saving it in the database (Microsoft Dataverse).
What are the different ways to Save a record in Dynamics 365?
Users can save a record in multiple ways as given below.
Sr No | Action to Save a record |
1 | When the user clicks on button “Save” |
2 | When the user clicks on button “Save & Close” |
3 | When the user deactivates a record |
4 | When the user reactivate a record |
5 | When the user sends an email message record |
6 | When the user qualifies or disqualified a Lead record |
7 | When the user assigns a particular record to another user |
8 | When the user click on button “Save & Complete” on an activity type entity |
9 | When the user clicks on button “Save & New” |
10 | When a record is auto-saved |
Getting the record Save Mode using JavaScript –
We can get the record’s saving mode with help of the getSaveMode client API.
getSaveMode (Client API reference)
Returns a value indicating how the save event was initiated by the user.
Below are the return values provided by the getSaveMode client web API.
Value | Save mode | Table |
---|---|---|
1 | Save | All |
2 | Save and Close | All |
5 | Deactivate | All |
6 | Reactivate | All |
7 | Send | |
15 | Disqualify | Lead |
16 | Qualify | Lead |
47 | Assign | User or Team owned tables |
58 | Save as Completed | Activities |
59 | Save and New | All |
70 | Auto Save | All |
JavaScript code snippet –
Use the below given JavaScript snippet to find the record Save Mode in Dynamics 365 CRM.
//CRM Crate - JavaScript Snippet
function CallMethod (executionContext) {
//Reading Event Arguments.
var eventArgs = executionContext.getEventArgs();
//Getting the record SaveMode.
var saveMode = eventArgs.getSaveMode();
alert("Record Save Mode = " +saveMode);
}
Thus, we learned and understood different record Save Modes in Dynamics 365 CRM. Before we start, make sure to subscribe to CRM Crate so that you stay up to date in the field of Dynamics 365.