Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
I have 1000 of account record GUIDs, want to know these records are shared to any team or any user.
Is there any programmatic way to approach?
Thanks & Regards,
since you are using crm online.
Use below fetchxml to find all the record that shared to user, but of course you have to change a little bit.
ps: you can create as a ssrs report.
You can also check below reference after retrieving the user or team how to share the records.
You can do this with "RetrieveSharedPrincipalsAndAccessRequest", please look at https://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.retrievesharedprincipalsandaccessrequest.aspx for more information.
Sample code is below;
RetrieveSharedPrincipalsAndAccessRequest request = new RetrieveSharedPrincipalsAndAccessRequest()
Target = new EntityReference(entityLogicalName, recordId)
var serviceResponse = (RetrieveSharedPrincipalsAndAccessResponse)IOrganizationService.Execute(request);
You can also use XrmLibrary (2015 or 2016) and just do it with simple 2 lines below (blue lines optional process)
CommonHelper commonHelper = new CommonHelper(_organizationService);
var sharedPrincipalList = commonHelper.GetSharedPrincipalsAndAccess(Guid.Parse("RECORD ID"), "ENTITY LOGICAL NAME");
if (sharedPrincipalList != null && sharedPrincipalList.Count > 0)
foreach (var item in sharedPrincipalList)
var principalInfo = item.Principal; //This returns EntityReference, so you can get PrincipalType (Team or SystemUser) and Id (for Team or SystemUser)
Business Applications communities