I am using Silverlight and querying CRM in the following manner:
query = (DataServiceQuery<ServiceAppointment>)myContext.ServiceAppointmentSet .AddQueryOption("$select", "ActivityId,Subject,StateCode,ScheduledStart,ScheduledEnd,ServiceId,new_RelatedOrderID,new_salesorder_serviceappointment_RelatedOrderID/OrderNumber,Contact_ServiceAppointments/ContactId,Contact_ServiceAppointments/FullName") .AddQueryOption("$expand", "Contact_ServiceAppointments,new_salesorder_serviceappointment_RelatedOrderID")
the relationship new_salesorder_serviceappointment_RelatedOrderID gives me the Order the ServiceActivity. came from. The order also has a relationship new_RelatedServiceAppointment that points to the originating Consultation which is also a ServiceActivity.
I need to be able to pull this originating Consultation and get the new_MyField from that.
How can I set up this DataServiceQuery to do that?