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

GetRelatedEntities("Contact_Phonecalls") get nothing

$
0
0

I am try to get contact phonecalls, so I use GetRelatedEntities, however, it return nothing. the flowing is the code:

foreach (Xrm.Contact one in contacts.Entities)
            {
                xrm.Attach(one);
                IEnumerable<PhoneCall> phoneCalls = one.GetRelatedEntities<PhoneCall>("Contact_Phonecalls");
                xrm.LoadProperty(one, "Contact_Phonecalls");
                phoneCalls = one.GetRelatedEntities<PhoneCall>("Contact_Phonecalls");
                foreach (Xrm.PhoneCall o in phoneCalls)
                {
                    object obj = o;
                }
            }

Any help needed!!!  I am sure the Relationship "Contact_Phonecalls" is correct

John


Viewing all articles
Browse latest Browse all 9244

Trending Articles



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