Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Find all emails related to a lead

$
0
0

Hi Forum,

Why do the linq query below return all email in the system, and not only the ones where regardingObjectID is pointing to a lead.

I would like to list all the emails, which are related to a lead.

     var crmDataAccess = new Common.CrmSdk.CrmDataAccess(null);
            using (crmDataAccess)
            {
                var Context = crmDataAccess.CreateOrganizationServiceContext<Context>();
                var emails = (from email in Context.EmailSet
                              where email.Lead_email != null
                              select email).ToList();
              return emails;

br henrik


--- Best regards Henrik Skydtsgaard



Viewing all articles
Browse latest Browse all 8223

Trending Articles



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