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