javascriptajaxdynamics-crmmicrosoft-dynamicsmicrosoft-dynamics-webapi

Get child data Microsoft Dynamics WebAPI


I am using the Microsoft Dynamics CRM WebAPI to access an on Premise version of Microsoft Dynamics CRM 2016. I have two custom entities ccseq_ProductEvaluation and ccseq_ProductEvaluationArea. ccseq_ProductEvaluation is the parent of ccseq_ProductEvaluationArea. I am trying to build the url to retrieve the ccseq_ProductEvaluationArea records for a specific ccseq_ProductEvaluation record. I have read the Dynamics API reference, but I have not been able to build the correct url. Below is the current url I have tried. What am I missing?

URL

https://mainurl.com/api/data/v8.0/ccseq_productevaluations?$expand=ccseq_productevaluationid

ccseq_ProductEvaluation

Product Evaluation Design

ccseq_ProductEvaluationArea

Product Evaluation Area Design

1:N Relationship

Relationship Details


Solution

  • The query should read like this:

    https://mainurl.com/api/data/v8.0/ccseq_productevaluations(915e89f5-29fc-e511-80d2-00155db07c77)?$select=ccseq_productname&$expand=ccseq_ccseq_productevaluation_ccseq_producteval($select=ccseq_evaluationarea)
    

    Here the guid should be replaced with the ID of the product evaluation record at hand.