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 a Custom entity called "CorpArticle" with the field "owininguser" which refers to "SystemUser"
How can I use LINQ to get the get the SystemUser entity using the "owninguser"?
Entity CorpArticle = new Entity("corp_article");
var articles = (from a in svcContext.CreateQuery(CorpArticle.LogicalName)
foreach (var a in articles)
//THIS DOES NOT WORK var user = svcContext.SystemUserSet.Where(u => u.Equals(a.Attributes["owninguser"])).First(); }
this should give you an idea
EntityReference owner = (EntityReference)a["owninguser"];
var user = svcContext.SystemUserSet.Where(t => t.Id == owner.Id).First();
I didn't test but should work, if doesn't work, you can play around to make it working. I don't know why you use owninguser but normally ownerid field is user (but can be a team as well)
That is exacly what I'm was looking for. Thnx.
Business Applications communities