Dynamics 365 CE Online
Enable Entity Records for Dynamics 365 Partner Portals
Category: CRM Dvelopment Series,Dynamics 365,Dynamics 365 CE Online,Dynamics 365 Portals,Dynamics Portal,Partner Portal view,Partner Portals Author: HIMBAP Date: 3 months ago Comments: 0

Introduction If you are working with Partner Portal, you may notice that you are not able to see records in Portal even though you have all the required permission setup correctly. We are going to discuss another quick check that you can do while not getting data. Solution Most common reason when you are not able to see the data… Read more »
Source: Mahendra Pal

Filtering Lookup based on the link entity
Category: adding custom view to lookup Dynamics 365 CE,CRM Dvelopment Series,Dynamics 365,Dynamics 365 CE Online,Lookup filtering in Dynamics 365 CE,Using under in FetchXML Author: HIMBAP Date: 4 months ago Comments: 0

Introduction Recently we got one request to filter lookup based on the account as well as parent account of the account. This blog post is about how we implemented this requirement. Solution If we want to filter lookup based on the other lookup we can simply edit target field properties and can set Related Record Filtering option. We can select… Read more »
Source: Mahendra Pal

Show All Views in Unified Interface App- Quick Fix
Category: Dynamics 365,Dynamics 365 App Designer,Dynamics 365 CE Online,Enable all entity views for Dynamics 365 CE Unified Interface Click,Not able to see all entity view in Unified Interface Author: HIMBAP Date: 6 months ago Comments: 0

Introduction Recently one of our customer started using Unified Interface Client and they reported that they are not able to see all the accounts view under Field Service App. This post is about how to fix this issue. Solution By default Unified interface only show some entity view for example if you will check in online trial under web client… Read more »
Source: Mahendra Pal

SharePoint integration for Work Order- Part 1
Category: Create SharePoint folder using Flow,CRM Dvelopment Series,Dynamics 365,Dynamics 365 CE Online,Implement Folder Structure using Flow,Implementing hierarchical folder structure using Flow,Microsoft Flow,Setting up SharePoint integration for Work Order using Flow,SharePoint Integration for Dynamics 365 Author: HIMBAP Date: 7 months ago Comments: 0

Recently while working on Field Service project, we got requirement to setup SharePoint integration where customer wanted to use Folder stricture based on the Account entity. By default entity based folder structure is not supported for work order entity so we used Flow to implement this requirement, in this article we are going to discuss the same.
Implement account entity folder structure for work order entity so that all the work order related documents is stored under parent customer folder hierarchy.
When I got this requirement, I thought it can be achieved using out of the box configuration but when I completed SharePoint integration setup and tested, I found , Dynamics 365 CE was not creating folder for work order entity under parent service account, instead it was creating work order folder under standalone work order document library. When I tried to upload document in child opportunity, it was creating opportunity folder correctly under parent account in SharePoint. When I was troubleshooting this issue, I found this KB Which explains why work order document is not create under account hierarchy because Work order entity have multiple N:1 relationship record with Account entity.

With the exception of the opportunity and contract entities, a hierarchical folder structure will not be automatically created in SharePoint for entities that have more than one many-to-one (N:1) relationship with the parent entity.

After identifying the issue, next step is to fix it with minimal efforts and Microsoft Flow came into my mind as I have used it earlier for SharePoint integration. let’s see how we can create Work Order structure under Account.

The whole Flow to create work order folder is divided into two parts, the first part is below where we added three steps:
1. First steps is to start flow when new work order record is created so we selected Create step from Dynamics 365 connector.
2. Second steps is to Get Record step to get service account record because we need customer name to for SharePoint folder path.
3. There is no direct option to create folder in SharePoint but we can use Create File option from SharePoint connector where we can upload dummy file, and it will setup folder for us :)

We have created SharePoint folder for work order under account it now, but Dynamics 365 CE SharePoint won’t use this folder unless we will setup Document Location record and that’s the tricky part. To create document library record, let’s first understand, how document location record is created in Dynamics 365 in case folder structure hierarchy. Here is the screenshot of the document location records, when we have uploaded document under opportunity created HIMBAP customer.
As you can see in above screenshot, 1 record is created for the Account folder in the SharePoint site location. After that we have record 2 created for HIMBAP account under the Account location. Further Opportunity record is created under the Account folder because we have implemented folder hierarchy structure. After that Demo opportunity record is created which referred Opportunity document location record, so these records are related using following sequence.


And we need to implement the same sequence for our work order entity. We will discuss document location part in the next article, so stay tuned !!

Source: Mahendra Pal

Working with Dynamics 365 Portals – Webinar
Category: Configure Web Role Scope in Dynamics 365 Portals,Dynamics 365,Dynamics 365 CE Online,Dynamics 365 Portal,Dynamics 365 Portals,Dynamics Portal,Understanding Web Roles in Dynamics 365 Portals Author: HIMBAP Date: 9 months ago Comments: 0

Web Roles are used to implement Dynamics 365 Portals security, just like we use security roles in Dynamics 365 CE. Every Dynamics 365 portal user must have assigned some web roles to access Dynamics 365 CE records. In the web roles we can configure entity permissions to implement record based security just like we can do in Dynamics 365 CE and up to what level you can access portal records depends on the scope. While configuring entity permissions we can use different scope like global, contact, account and self.


If you recently started with working Dynamics 365 Portals or have experience with Dynamics 365 Portals but still confuse about how Dynamics 365 Portals security is configured using Web Roles let’s discuss, I am presenting how to implement Dynamics 365 Portal Web Roles this Saturday 18 May at 4 PM IST.

Event URL: https://bit.ly/2HiX12r

> Understanding Security in Dynamics 365 Portals
> Working with Web Roles
> Know about Scoping in Web Roles
> Configure Entity Permissions for Web Roles
> Demo

Source: Mahendra Pal

Updating from party in Email
Category: Changing email from partylist,CRM Dvelopment Series,Dynamics 365,Dynamics 365 CE Online,update from in email using plugin Author: HIMBAP Date: 1 year ago Comments: 0

Recently while working on one business requirement where client had two business unit and they were using contacts specific to business unit which means they can have duplicate records for contact or account. While email coming into CRM they wanted to update email from with correct contact from correct business unit if wrong contact is auto populated by CRM. In this article we are going to provide details how we can update from using pre operation plugin.

Check from party contact business unit, if it’s not correct update from with correct contact.

We can retrieve from party list from entity object and loop through it like following

if (emailEntity.Contains("from")) {
 EntityCollection from = emailEntity.GetAttributeValue < EntityCollection > ("from");
 //create sender list
 EntityCollection senderList = new EntityCollection();
 if (from != null) {
  from.Entities.ToList().ForEach(party => {
   Guid newContact = Guid.Empty;

   //get party list
   EntityReference partyId = party.GetAttributeValue < EntityReference > ("partyid");
   string contactName = party.GetAttributeValue<string>("addressused");
   //process partylist



Our requirement is to check if from party list is contact type if yes, get and check if it is from correct BU if not get contact from correct BU, if not present create it and set it under from

if (partyId.LogicalName != null && partyId.LogicalName == "contact") {
 //retrieve current associated contact
 Entity currentAssociatedContact = emailLogic.GetContact(partyId.Id);

 //validate for correct contact 
 if (!CheckContactForBU(currentAssociatedContact, ownerid)) {
  //create contact in correct BU
  newContact = CreateContact(contactName, ownerid);

  //add partylist to from
  Entity partyFrom = new Entity("activityparty");
  partyFrom["partyid"] = new EntityReference("contact", newContact);
  partyFrom["addressused"] = contactName;


And finally we can assign sender list to from like following

if (senderList.Entities.Count > 0)

                                emailEntity["from"] = senderList;

We need to use this code on pre operation of email entity.This way we can change from email address before creation as after record created it can’t be changed.

Hope it will help someone !!

Source: Mahendra Pal

Get contact based on name and it’s BU- Sample Code
Category: Dynamics 365,Dynamics 365 CE Online,Get contact based on Business Unit name,Get contact business unit using query expression,MS CRM 2015,Ms CRM 2016,Query Expression,Using link entity with query expression Author: HIMBAP Date: 1 year ago Comments: 0

If you got requirement to get contact record based on it’s full name and it’s business unit name, this sample code will help you. Sharing following sample code to get contact using Query Expression.

public Entity GetContactByFullNameandBUName(string contact,string businessunit)
            Entity contactEntity = null;

            // setup query expression to query contact for fullname and BU
            var query = new QueryExpression("contact");
            query.Criteria.AddCondition("fullname", ConditionOperator.Equal, contact);
			//add link entity condition
            var linkEntity = query.AddLink("businessunit", "owningbusinessunit", "businessunitid");
            linkEntity.EntityAlias = "BU";
            linkEntity.LinkCriteria.AddCondition("name", ConditionOperator.Equal, businessunit);
			//execute query
            EntityCollection results = organizationService.RetrieveMultiple(query);

           if (results.Entities.Count>0)
                contactEntity = results.Entities.FirstOrDefault();

            return contactEntity;

Hope it will help someone !!

Source: Mahendra Pal