web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Fetching records with EarlyBoundGenerator doesn't fetch all the information

(0) ShareShare
ReportReport
Posted on by 17

We are using EarlyBoundGenerator to create a ServiceContext that we then can use Linq arguments to query Dynamics.

But we have been experiencing some problems, that from time to time it won't fetch all the fields, or rather some fields won't be populated with the data from Dynamics.

The following code:

var ac = (from acc in commonContext.Context.AccountSet
where acc.Id == commonContext.AccountId
select acc).FirstOrDefault();

When I then do some tracing to see what we get out it doesn't give me the data that is in Dynamics.

    commonContext.TracingService.Trace($"ac: {ac?.Id}, BusinessUnit: {businessUnitId}, Name: {ac?.Name}, Number: {ac?.zync_customernumber}, Country2: {ac?.zync_Address2Country?.Value}, Country1: {ac?.zync_Address1Country?.Value}");
    commonContext.TracingService.Trace($"phone: {ac?.Telephone1}, Email: {ac?.EMailAddress1}, Org: {ac?.zync_Organizationnumber}, Einvoice: {ac?.zync_einvoiceemail}");

In the above we get the Id and BusinessUnitId, but Name and Number does not get populated despite them having data in Dynamics.

Anyone having a similar problem and knows how to get around this problem. Right now we will either use a fetch query or use the organizationservice instead. 

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hi,

    I tried in my console application with below code and it works as expected

    var context = new CrmServiceContext(crmSvc);
    
    var ac = (from acc in context.AccountSet
    
    where acc.Id == Guid.Parse("3f064184-e294-eb11-b1ac-0022486e888c")
    
    select acc).FirstOrDefault();
    
    Console.WriteLine($"Account Name: {ac.Name} Email Address:{ac.EMailAddress1}");

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 103 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 83

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans