Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 71679

Forum Post: RE: LINQ query to get the first contact?

$
0
0
Hi, If you have the ID of the contact you can retrieve it directly instead of querying: public void Execute(IServiceProvider serviceProvider) { IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); var contact = service.Retrieve("contact", theId, new Microsoft.Xrm.Sdk.Query.ColumnSet(true)); {...} } Hope this helps! I'd appreciate if you'd mark this as a Verified answer. Thanks, Aiden

Viewing all articles
Browse latest Browse all 71679

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>