January Problem Solver of the MonthCongratulations to Sourav Dam for be selected in our monthly random drawing, Dynamics Community Problem Solver Sweepstakes.
Read aboug Sourav | Learn how to enter
2020 release wave 1 Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
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 | Upcoming TechTalks
I have Workflows and Entities project withing my VS solution. Entities.cs file under Entities project is autogenerated using CrmSvcUtil.exe, containing early bounded entitiies.
I need to have BusinessUnit, Organization and etc. types in my CodeActivity workflow.For this purpose I added Entities folder under Workflows project and within it Entities.cs file has been added as a link (tried also with adding Entities dll as reference - same result) and I have the following code:
all needed using were added
using (var dataContext = new CrmDataContext(service))
BusinessUnit businessUnit = dataContext.BusinessUnitSet.Where(o => o.Id == businessUnitId).FirstOrDefault();
if (businessUnit != null)
Organization orgSetting = dataContext.OrganizationSet.Where(o => o.Id == businessUnit.OrganizationId.Id).FirstOrDefault();
if (orgSetting != null)
//some logic here
In CRM using my CodeActivity in custom workflow I have the following error:
The specified type '[MyWorkflowsNamespace].Entities.BusinessUnit' is not a known entity type.Code
I googled it and found that adding [assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute()] to AssemblyInfo should help, but it didn't.
My guess is that somhow CrmDataContext is not being initialized correctly. But here my knowlege is limited and I don't know what to look for.Have any of you experienced this issue? What could possibly cause such?
Allright, found the issue myself.
var dataContext = new CrmDataContext(service)
CrmDataContext dataContext = new CrmDataContext(service)
Business Applications communities