Skip to main content

Posts

Showing posts from December, 2017

Synchronous and asynchronous XMLHttpRequest in Javascript from Microsoft Dynamics CRM perspective

Below are the examples of Synchronous and Asynchronous XMLHttpRequest. Asynchronous request var req = new XMLHttpRequest(); req.open(requestType, serverURL + "/api/data/v8.2/" + query, false); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Accept", "application/json"); req.setRequestHeader("Content-Type", "application/json; charset=utf-8"); req.setRequestHeader("Prefer", "odata.include-annotations=\"*\""); req.onreadystatechange = function () { if (this.readyState == 4 /* complete */) { req.onreadystatechange = null; if (this.status === 200) { var data = JSON.parse(this.response); fnSuccessCallback(data); } else { var error = JSON.parse(this.response).error; ...

Unable to see field on table in DB even after Synchronization in AX 2012

I was in front of an issue where new fields added on the AOT table were not visible in the database even after a successful synchronization. After some efforts, to find a solution, I found a solution below which is given in a post and it worked for me. Check below configuration 1.        Go to field properties (fields which are not able to visible in database table) 2.        Check EDT 3.        Go to EDT property 4.        Check configuration key. 5.        Go to Administration -> System -> Configuration 6.        Check configuration and Apply. thanks p.

Call javascript function on sub-grid refresh/load in Microsoft Dynamics CRM

Recently, I came across a requirement where I had to do some calculation based on records added/deleted in sub-grid on CRM form. To achieve this, I have added load event on sub-grid in javascript where I could call the method which is doing the calculations. Below piece of code will be used to add load event on sub-grid and function addEventToGridRefresh() should be registered on form load. function addEventToGridRefresh() { // retrieve the subgrid var grid = Xrm.Page.getControl('#GridControlName#'); // if the subgrid still not available we try again after 2 second if (grid == null) { setTimeout(function () { addEventToGridRefresh(); }, 2000); return; } // add the function to the onRefresh event Xrm.Page.getControl('#GridControlName#').addOnLoad(totalAssetsOfHousehold); // This is used to delay refresh by 1 second because sometimes grid takes time to load. // If you do not include below line, you may not ...