Showing posts from August, 2017

Microsoft Flow – Create record in Dynamics 365

Recently we received a requirement to integrate a mailbox not configured in CRM and external to CRM with Dynamics 365. The client had an enquiry mailbox, and they did not want the emails to be created in CRM, and therefore it was not configured. However, they did want that the lead should be automatically created for all enquiries received. That is where  Microsoft Flow  came to the rescue. Using Flow, it is possible to design process flows to automate integrations with external systems. Here we discuss the steps to create a lead in Dynamics CRM for every email received on a Gmail id. Steps to create the flow: 1 . Go to  and click the Flow as shown in the screenshot below; 2 . Click on  ‘Create from Blank’  button as shown in the screenshot below; 3 . Select  ‘Gmail – When a new email arrives’,  it will then ask you for the Gmail credentials, enter the appropriate credentials. 4 . Now select  ‘Inbox’  as seen in the screenshot below; 5

Field Validation Editable Grids

Scenario Say I want to get the value of an editable grid cell on change and add some validation on it. I have a field called ‘Contact Code’ and I want to be notified if I enter a value that is less than 4 characters. We need a way to reference the current field that was entered and validate its value. getFormContext Method (Introduced in Dynamics 365) The key is to pass the context object a parameter to the  OnChange  grid event and then use the  getFormContext  method to return the reference of the grid. The handy thing about this is that it can return a reference to either a Form or Grid control depending on where it was called. function EditableGridFieldValidation(executionContext) {     var gridObject = executionContext.getFormContext().data.entity;     var contactCodeValue = gridObject.attributes.getByName('new_contactcode').getValue();     var contactCodeField = gridObject.attributes.getByName('new_contactcode').controls.getByIndex(0);

Show Hide Sections in Dynamics CRM

/************************************************ stateSectionsOnChange - function to handle which fields to show based on the state selected ************************************************/ function stateSectionsOnChange() {     var closeTab = Xrm.Page.ui.tabs.get("Professional Info"); var showTXSection = false;     var showOHSection = false;     var showINSection = false;     switch (Xrm.Page.getAttribute("col_addressstate").getText()) {         case "Texas": showTXSection = true;             showOHSection = false; showINSection = false;             break;         case "Ohio": showTXSection = false;             showOHSection = true; showINSection = false;             break;         case "Indiana": showTXSection = false;             showOHSection = false; showINSection = true;             break;     }     closeTab.sections.get("Texas").setVisible(showTXSection);     closeTab.s

Configure View Columns for Global Search

Recently, I was asked to change the "View Columns" on CRM Global Search. Typically, there is no seperate view for Global Search. It works on Quick find view of the configured entities for Global search, where it looks for "Find Columns" to run its quick find searches. So, I started looking into Quick find view. After little bit research, I found Global Search shows first three columns of Quick Find view in the searches. So I just changed the order of the few columns, moved the requested View Columns to first three and Voila! its done. 

Convert Plugin to Sandbox mode,

While working with Dynamics CRM Plugins, the thumb rule for Plugin Registration is: If you are working with CRM On-Premise, use Plugin isolation mode as  None. If you are working with CRM Online, use Plugin isolation mode as  Sandbox. So, now the scenario is you are working on big implementation for CRM On Premise. Now your organization decides to move to CRM Online. The first task comes to mind is to move all the Plugins to Sandbox mode and see if they are still working considering running Plugin in sandbox comes with some  limitations  (such as you cannot access file system/registries/external assemblies/protocols/IP Addresses etc). To convert the Plugin assemblies to Sandbox mode, one option is to open Plugin Registration tool and convert the assemblies one by one which is a tedious task. The other simple option is do this by Customization.xml file. Below are the steps how to do that. Create a solution with all Plugin assemblies or use existing solution if already a

Data Import Security Role for Dynamics CRM

Recently, someone asked on one of the community forum that what all privileges should be given to allow Data Import to Dynamics CRM. I responded but thought that it would be helpful if I write in one of the blog so that it benefits others as well. If we think of import process to CRM, it works as below: Source file gets uploaded. It will prompt for data mapping. Data Map record gets created and you can start seeing the status for the file being imported under Settings-->Import. Data gets imported and records created. So broadly if someone want to import the records, he definitely should have Create, Read and Write permission on the entity, he wants to import. Along with that he should have privileges on following entities:  Entity  Security Role Tab  Privilege  Import Source File  Core Records User Level  Create, Read, Write, Delete, Append, Append To  Data Import  Core Records  User Level  Create, Read, Write, Delete, Append, Append To  Data Map  Core Records