IHonest Blog
Harnessing Microsoft Power for Expert Business and Technical Solutions
Posts about:
Microsoft Dynamics CRM (Technical)
Ways to Call Web API in Dynamics CRM with JavaScript
Below are the various methods to call the Dynamics 365 Web API from JavaScript on an Account form. Each method is demonstrated with a code example, such as retrieving an Account record or updating a Contact. These examples assume they are executed within a form event (e.g., OnLoad
, OnChange
) and use the executionContext
.
Form-Level JavaScript Actions for Account Form in MS Dynamics CRM v9.2 (Samples)
1. Checking Form Type
The form type indicates whether the form is in create, update, read-only, or another mode.
Dataverse REST API (Javascript)
Read MoreRenewing Certificates for Dynamics CRM (v8.2) On-Premise: A Step-by-Step Guide
Sample Plugin Code

Monitoring Data Exports in MS Dynamics CRM
Monitoring data exports from Microsoft Dynamics CRM on-premises involves tracking user activities and system events to identify instances of data export. While the specifics can vary based on your organization's setup and security policies, here are some general steps you can take to monitor data exports:

Masking Field Values (e.g., Credit Card Numbers) in MS Dynamics CRM
Custom JavaScript: Code Sample
//Open the form customization interface.
//Locate the OnLoad event in the form's properties.
//Add the JavaScript code to the OnLoad event's script editor.
//Save and Publish customizations
//Remember to replace "new_cardnumber" with the actual schema name of your card number fieldfunction maskCardDetails() {
var cardNumberField = Xrm.Page.getAttribute("new_cardnumber"); // Replace with your field name
if (cardNumberField) {
var cardNumber = cardNumberField.getValue();
if (cardNumber) {
var maskedCardNumber = "**** **** **** " + cardNumber.slice(-4);
cardNumberField.setValue(maskedCardNumber);
}
}
}
// Attach the function to the form's OnLoad event
Xrm.Page.data.entity.addOnLoad(maskCardDetails);