Search code examples
odatacrmdynamics-crm-2013child-nodes

Retrieve xml childnode using Odata in dynamics CRM


I've a problem when i try to pass a childnode attribute as a parameter using Odata in dynamics crm 2015!

for example: when i pass a parentnode it works fine!

but when i pass a child node it does not work : https://ServerURL/XRMServices/2011/OrganizationData.svc/InvoiceSet?$select=Name,InvoiceNumber,TotalAmount,TransactionCurrencyId&$filter=CustomerId/Name eq 'AttributeValue'

i also tried the "$expand" function but it doesn't work! https://ServerURL/XRMServices/2011/OrganizationData.svc/InvoiceSet?$expand=Account_Invoice&$filter=Account/Name eq 'AttributeValue'

Your help will be greatly appreciated


Solution

  • Did you try using the OData Query designer?

    You could build the query using the UI to make sure it works without wasting time messing with the OData query uri.

    Also, please do not use the ServerUrl (assuming you are using .serverUrl()) on client side, always use the clientUrl() property. CRM might be deployed on a different machine name / url than the Url exposed via IIS.