{% fetchxml my_query %} <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="salesorder"> <all-attributes/> <link-entity name="salesorderdetail" from="salesorderid" to="salesorderid" visible="true" link-type="inner" alias="orderalias"> <attribute name="description"/> </link-entity> </entity> </fetch> {% endfetchxml %} {% for result in my_query.results.entities %} Order Number: {{ result['orderalias.description'] }} {% for res in result['orderalias'] %} Order Number: {{ result.ordernumber }} <br/> Product: {{ res.description }}<hr/> {% endfor %} {% endfor %}
I've been trying to display the result of my link entity together with the parent entity, this is one to many relationship, where salesorder might contain more than one or more salesorderdetails, what i want to do is to display each salesorderdetails for each salesorder. Above is my sample code but unable to display it properly. What am I missing here? What syntax should I use to achieve it?
*This post is locked for comments