What’s new changes in Dynamics 365 version 9 – Useful Links

General Changes : https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/new-in-version-9

For Developers : https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/new-in-version-9-for-developers

Importan changes (Deprecations) coming : https://docs.microsoft.com/en-us/dynamics365/get-started/whats-new/customer-engagement/important-changes-coming


Some useful links which will help you during Upgrade project (Version 8.2 to 9): 


All JavaScript Changes – Dynamics 365 9.0


Dynamics 365 9.0 Client-side navigation


For XRM.Utility.OpenEntityForm changes:



Dynamics 365 9.0 Client-side navigation


For RibbonWorkBench changes:





How to replace Xrm.Page.context.getClientUrl() in Dynamics 365 version 9

Xrm.Page.context.getClientUrl() : Returns the base URL that was used to access the application.

In Version 9 :

var globalContext = Xrm.Utility.getGlobalContext();


For more details refer this link: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-utility/getglobalcontext/getclienturl


Update OptionSet value of related entity on change of another OptionSet(Parent entity) using Web API JavaScript

How to update OptionSet value of related entity on change of another OptionSet value using Web API – JavaScript. Or How to update subgrid field values using Web API(client side java script).

I need parent entity optionset value on child entity when it change. As we are aware that we can copy field value to related entity using “field mapping” but the case where field value change frequently then “field mapping” will not work – for example – Status field. Suppose, I have an optionset for status field which change frequently and it’s normal.

There are two ways to achieve it – One is to write plugin which will change optionset value of child entity based on parent entity optionset value change and two – write JS using Web API to update related entity field.

function updateOptionSetValue() {
var status = Xrm.Page.getAttribute(“statusfieldschemaname”).getValue();
if (status != “”) {
var rowCount = Xrm.Page.getControl(“subgridname”).getGrid().getTotalRecordCount();
for (var i = 0; i < rowCount; i++) { //Read last record values
var allRows = Xrm.Page.getControl(“subgridname”).getGrid().getRows();
var allGridRowData = [];
allRows.forEach(function (row, i) {

//Read values of all the child grid fields and update Status value
for (var i = 0; i < allGridRowData.length; i++) {
var Name = (allGridRowData[i].getEntity().getAttributes().getByName(“name”).getValue());
if (Name != null) {
var recordId = Xrm.Page.getControl(“subgridname”).getGrid().getRows().get(i).getData().getEntity().getId();
var ID = recordId.replace(/\{|\}/gi, “”);
var data = {
“value”: status

var req = new XMLHttpRequest();
req.open(“PATCH”, Xrm.Page.context.getClientUrl() + “/api/data/v8.2/entityschemaname(” + ID + “)/relatedentityoptionsetschemaname”, true);
req.setRequestHeader(“Accept”, “application/json”);
req.setRequestHeader(“Content-Type”, “application/json; charset=utf-8”);
req.setRequestHeader(“OData-MaxVersion”, “4.0”);
req.setRequestHeader(“OData-Version”, “4.0”);
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 204) {
//Xrm.Utility.alertDialog(‘Record Updated Successfully.’);
} else {

How to configure Email using Server Side Synchronization in CRM 2016 Online?

How to configure Email using Server Side Synchronization in CRM 2016 Online?

Arun Potti's MS CRM blog

Follow the below steps to Configure Email in CRM 2016 Online,

Step 1:Click here and follow my previous article to configure Office 365 Enterprise E3 Trial Subscription and Assign Product License to the required user.

Step 2: Go to Microsoft Dynamics CRM -> Settings -> Email Configuration.

Click on Email Server Profiles.

Server Side Synchronization - Step 2

Microsoft Exchange Online” Email Server Profile record created automatically by Online CRM. We can use the same.

Server Side Synchronization - Step 2.1Step 3: Open the “Microsoft Exchange Online” Email Server Profile record.

Click on Mailboxes (1) and Search for required User Mail Box record (2) and Open it (3).

Server Side Synchronization - Step 3.0

Update Email Address field with your Office 365 Login Id and Save.

Server Side Synchronization - Step 3.1Step 4: Click on Approve Email ribbon button and Click on OK.

Server Side Synchronization - Step 4Step 5: Click on Test & Enable Mailbox ribbon button and Click on OK.

Server Side Synchronization - Step 5Step 6: Click on Alerts to…

View original post 151 more words

How to configure subscriptions in MS CRM 2016 Online?

How to configure “Office 365 Enterprise E3” Subscription in Online CRM 2016?

Arun Potti's MS CRM blog

Follow the below steps to configure Office 365 Enterprise E3 Subscription in Online CRM 2016.

For more details on Office 365 Enterprise E3, please Click here.

Step 1: Create CRM Online 2016 30 days’ trial version. Click here to create.


Use the existing trial Version, if you have.

Step 2: Open https://portal.office.com/. Provide your credentials and Sign in.

99.Office 365 LoginStep 3: Under Office 365 Admin center preview Home Page,

  1. Click on Billing.
  2. Click on Subscriptions.
  3. By default, can see only one Subscription “Microsoft Dynamics CRM Online Trial” for 30 days.

Click on Add subscriptions, to find & subscribe Office 365 Enterprise E3 Trial Version.

99.Admin center preview - SubscriptionsStep 4: Under Enterprise Suite, can see “Office 365 Enterprise E3”.

  1. Hover on it, and click on Start free trial.

99.Enterprise Suite2. Click on Try now.

99.Confirm your order

3. Click on Continue.

99.order receipt

4. Within few minutes, the subscription will…

View original post 158 more words

Javascript – Prevent Save

Microsoft Dynamics 365 and Unified Service Desk

From time to time you might need to add some validation to the save event of an entity, this actually used to be an approach I would use on a regular basis but since the introduction of business rules have found myself doing this less and less. But still, knowing the ability is available is handy.

When you define the onsave event function, you must tick the “Pass execution contact as first parameter” option. (See below)

Having done that you can create an onSave function with code similar to the example I have shown below. Note forgetting the “(context)”, which will take the context parameter allowing you to prevent the save when needed.

function onSave(context) {
  var saveEvent = context.getEventArgs();
  if (Xrm.Page.getAttribute("telephone1").getValue() == null) {
    // *** Note: I am using an alert for testing a notification maybe better!
    alert("Put in a phone number!");

Note: This simple…

View original post 30 more words

Add days to date using JavaScript in Dynamics CRM

This blog post is related to Datetime field in CRM. In many scenarios, we want to recalculate the date field value in Dyanamics CRM by adding days to it. The below JavaScript function is useful in that condition :

//Function to add days to date

function addDays(date, days) {
var result = new Date(date);
result.setDate(result.getDate() + parseInt(days));
return result;

//Recalculate date field value

function recalculateDateFieldValue() {
var date= Xrm.Page.getAttribute(“datefieldname”).getValue();

if (firstemaildueDate != null) {
Xrm.Page.getAttribute(“datefieldname”).setValue(addDays(date, 42));

we can recalculate date field value by adding days as per our needs by checking conditions. Hope this helps.!