Disable UCI for default page load – Dynamics 365

Recently, while creating a D365 trial, I observed that by default, UCI is enabled for new trials commissioned. And it’s quite tricky to switch to previous UI before UCI, for people like me ;). I called it tricky, because, you will find it hard to see the options, needed for switching the UI mode, if you are adapted to use prior UI.

Below are the steps, to switch the UI from UCI to a normal mode 🙂 :

  • When a new trial was provisioned for me, I got below UI:



By default, I was taken to App picker page.

If you observe the URL, you will see, forceUCI is set to 1. And pagetype points to apps.

When I tried to change forceUCI to 0 or false, below is the screen set. However I was not able to see any menu options in the UI.



In above Image, you will see, that forceUCI is set to 0, but I was not able to see any menu options.

  • To change the UCI mode to ‘No’ at system level, we need to do it from Administration. However, in UCI, I was not able to see the Settings menu :(.

I went to ‘Dynamics 365 – Custom’ app, to check, if I can see the settings menu, but I was not L. Below is the screenshot.


  • Finally I went to advanced settings as below, which open a new tab, with Settings page, with UI without UCI 😦



  • We can then navigate to Settings -> Administration:


  • Click on System Settings.
  • Under General Tab, There is an option named ‘Use the new Unified Interface only (recommended)’. Set ‘No’ for it.



  • Happy CRMing 🙂

Forums in Dynamics 365 Portal Add-on

In this blog we will be discussing about forums available on Portal Add-on in dynamics 365.
Firstly we understand major components in understanding the forums in Dynamics portal.

– Forums are basically open spaces for discussion among members for a specific topic. For eg: CRM, AX, BI, etc. We don’t have multiple forums for same topic.
Forum Threads – Forum Threads are the Problem/ Question/ Discussion Point associated under a forum. For eg: All questions related to CRM will be added as Forum threads under forum for CRM.
Forum Posts – Forum Posts are the Posts and replies on a same forum thread. For eg: All responses for a particular question on CRM will be added as Forum posts.

Steps to add new forum in CRM. (We can create new Forum for the portal only from CRM.)

  • Log in CRM.
  • Go to Community -> Forums


  • The list will show you already existing active forums.
  • Click on New, to create new Forum. (Ideally forum is topic specific. For eg: CRM, AX, BI, etc.)
  • Fill in the below details for the forum as in below image:


Name: Name of the forum.
Website: Website on which this forum is to be published.
Parent Page: Web Page under which you wish to display the forum.
Partial URL: Partial URL for the forum.
Publishing State: Publishing state of the forum page.
Forum Page Template: Page Template for the forum.
Description: Text that gives description for the Forum.
Thread Page Template: It indicates the page template to be used for Threads associated with Forum.

Few fields will be locked and auto-populated:
Thread count: Indicates number of threads for the forum.
Last Post: Lookup to last forum thread posted.
Post count: Indicates number of posts associated with the forum.

  • Click Save. This will save the Forum and you can now see it on the Portal.
  • Forum Threads: After saving the record you can now see all the associated threads in the sub-grid for Forum threads.
  • Announcements: You can also add announcements for a forum by adding announcement record for the forum from the Announcement grid.
  • Access Permission: You can also restrict a forum to set of users on the portal.

Forums in the Portal will look like in below images:

  • Forum list:
  • Forum Page (with list of threads for the forum and also the Announcement):

Note: In my next blogs I will try to cover Forum Thread and Forum Post in detail.

Show unrelated records in Sub-grid based on Lookup field


This blog intends to showcase the capability of displaying non-related records in a Sub-grid based on a field on the record.

There are 2 steps we need to follow to achieve it.

  1. We change the FetchXml attribute of the sub-grid.
  2. Hide ‘New’ and ‘Open Associated View’ buttons on the grid

1) We change the FetchXml attribute of the sub-grid:

Note: This is unsupported.

Script to change the FetchXML attribute for the sub-grid:
//' Display All Custom for associated Account
function DisplayCustomRecords() {
    //Declare variable
    var AccountID = "";
    var ObjSubGrid = "";

    //'Get SubGrid
    ObjSubGrid = window.parent.document.getElementById("id_of_subgrid");
       if (ObjSubGrid == null) {
        setTimeout(DisplayInitiatedToDoNext, 3000);
    } else {
        //Get Account ID
        AccountID = getLookupDetails('msdyn_serviceaccount');
        if (AccountID!= "") {
            //' Declare fetch XML
            var FetchXML="<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"
                                + "<entity name='entityname'>"
                                + "<attribute name='new_id' />"
                                + "<attribute name='new_name' />"
                                + "<attribute name='new_keyaccountid' />"
                                + "<order attribute='new_name' descending='false' />"
                                + "<filter type='and'>"
                                  + "<condition attribute='statecode' operator='eq' value='0' />"
                                  + "</filter>"
                                + "<link-entity name='account' from='accountid' to='new_keyaccountid' alias='aa'>"
                                        + "<filter type='and'>"
                                    + "<condition attribute='accountid' operator='eq' uitype='account' value='" + AccountID + "' />"
                                    + "</filter>"
                                    + "</link-entity>"
                              + "</entity>"
                            + "</fetch>"
            ObjSubGrid.control.SetParameter("fetchXml", FetchXML);
            //Refresh grid to show filtered records only. 
    function getLookupDetails(lookupSchemaName) {
        var lookupObj = Xrm.Page.getAttribute(lookupSchemaName); //Check for Lookup Object
        var lookupRecordGuid;
        //var lookupRecordName;
        if (lookupObj != null) {
            var lookupObjValue = lookupObj.getValue();//Check for Lookup Value
            if (lookupObjValue != null) {
                var lookupEntityType = lookupObjValue[0].entityType, //To get EntityName
                lookupRecordGuid = lookupObjValue[0].id; // To get record GUID
                //lookupRecordName = lookupObjValue[0].name; //To get record
        return lookupRecordGuid;



Note: FetchXMl used in above code is only for representational purpose. You have to generate your own FetchXML.

We will call above function on tab-state change event of the form. And set the tab, not to expand by default.



Note: Also there should be link-entity condition, rather than filter condition for Lookup field, based on which we will populate the sub-grid records.

Note: Another thing I observed is, many people face error, when they have multiple grids in a single tab. It is advised that we have our grid (whose records we are populating using above code), in an individual tab.

2) Hide ‘New’ and ‘Open Associated View’ buttons on the grid:

Another thing that we have to take care of, is to hide the ‘New’ and ‘Open Associated View’ buttons on the grid, since the script that we have written will not work on associated view page.

This we can achieve using Ribbon Workbench. You can attain that by following below link:

There is no need to using the script mentioned in the link. You can directly hide the buttons.


Pinning frequent Views and Records in Dynamics 365

Hello All,

Many times it becomes hectic for the end user to navigate among different records belonging to different entities. There are lots of clicks required. For instance, when a person wants to see ‘My Team Members Resolved Cases’ on the Case entity, while he is on the ‘Active Accounts’ view on Accounts entity. In that case, he will have to click on Service -> Cases -> then select the desired view.

Dynamics 365 helps achieve moving to particular View or record in a just a single-click.

Dynamics 365 offers pinning of the views and Records which are frequently visited.

This pinned views and records, appear in the recent records section in the ribbon.

You can pin/unpin records as per your convenience.

[Resolved] – EntityState must be set to null, Created (for Create message) or Changed (for Update message)

Recently I was facing an issue with Update of a record in the Plugin. The error message was as ‘EntityState must be set to null, Created (for Create message) or Changed (for Update message)’.

The plugin was written on Post-Operation of Create action.

After looking for the resolution for the issue, I came across a solution posted online, which I am not sure, is supported, but worked for me.

Before calling the _service.Update(Entity), You need to change the state of entity as below:

recordToUpdate.EntityState = EntityState.Changed;

Hope this helps.

Also there is another approach to resolve this:

Instead of using






The request channel timed out while waiting for a reply after 00:01:59.9430000. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. dynamics crm

Recently I was facing another issue with BulkInsert from my console to D365, using ExecuteMultiple. As per the documentation on MSDN, ExecuteMultiple has run-time limitation to have maximum batch-size of 1000.

Link: https://msdn.microsoft.com/en-in/library/jj863631.aspx

However, I was facing time-out issue for 999.

Turns out, I need to specify a smaller batch size to overcome this issue.

Specifying batch size as 500 was working fine for me.

Custom CSS for Dynamics CRM Portals

This blog is intended to showcase capabilities of Dynamics CRM portals to accommodate custom CSS for UI changes.

For adding any custom CSS for the portal, we need to add bootstrap.min.css as a child file of “Home page” on the portal.

Steps for adding CSS file on portal:

Step1: Create a custom bootstrap.min.css having required changes for the UI of the portal.

You can create custom CSS using below references:



Step2: Login into the Portal with credentials having Administrator security role.

Step3: Navigate to Home page.

Step4: Add a new Child file to Home page using “Administrator” panel on the upper right side of the screen.


Step5: Browse the updated bootstrap.min.css.

Name and partial URL fields will be auto-filled.


You can choose to hide the child file from the Site map.

Step6: Click on Save.

By performing above steps, you can have custom UI changes on the Portal.

Note: In some cases, changes are not reflected immediately on the portal. For this, kindly restart the portal and check.

Download SharePoint file programmatically without sharing it – Dynamics CRM and (ADX portal or custom portal)

Download SharePoint file programmatically without sharing it – Dynamics CRM and ADX portal or custom portal

Resolved: The request message is too big. The server does not allow messages larger than 2097152 bytes in Sharepoint

Hello everyone,

Today I was trying to upload a document on Sharepoint programmatically. However due to file size limitation for uploading a file on Sharepoint, I got the issue “The request message is too big. The server does not allow messages larger than 2097152 bytes.”

I googled the resolution for the issue, but almost every resolution involved running the Powershell script.

However I didn’t want to run the powershell script and yet wanted to resolve my issue.

So after some R&D and googling, I found the resolution as below:

I was using below code for setting the content of the message

//fileData being the document body of my attachment.

Instead of using the Content method of FileCreationInformation, I used ContentStream as below:

FileCreationInformation.Content=new MemoryStream(Convert.FromBase64String(fileData));

This resolved the issue.

Points to consider when chosing the method:

File upload option Considerations When should you use this? Supported platforms
Content property on theFileCreationInformation class. Maximum file size that can be uploaded is 2 MB. Time-out occurs after 30 minutes. Use to upload files that are less than 2 MB only. SharePoint Server 2013, SharePoint Online
SaveBinaryDirect method on the File class. No file size limits. Time-out occurs after 30 minutes. Only use this method if you’re using a user-only authentication policy. User-only authentication policy is not available in an app for SharePoint, but can be used in native device apps, Windows PowerShell, and Windows console applications. SharePoint Server 2013, SharePoint Online
ContentStream property on theFileCreationInformation class. No file size limits. Time-out occurs after 30 minutes. Recommended for:

  • SharePoint Server 2013.
  • SharePoint Online when the file is smaller than 10 MB.
SharePoint Server 2013, SharePoint Online
Upload a single file as a set of chunks using the StartUpload,ContinueUpload, andFinishUpload methods on theFile class. No file size limits. Time-out occurs after 30 minutes. Each chunk of the file must upload within 30 minutes of completion of the previous chunk to avoid the time-out. Recommended for SharePoint Online when the file is larger than 10 MB. SharePoint Online