I have an Order CDT with a nested Item CDT (1 order can have many items).

I have an Order CDT with a nested Item CDT (1 order can have many items).

I am trying to retrieve all items ordered by a specific customer.

local!orders: getOrdersByCustomerId (ri!customer.id,local!pagingInfo).data

from local!orders how can I get all of the items?

OriginalPostID-211136

OriginalPostID-211136

  Discussion posts and replies are publicly visible

Parents
  • The result of the query leaves you with a list of lists due to the nested multiple CDT. Dot notation nor the index function will be able to easily grab the items as a result. The way to get the information is to flatted the nested list as outlined by the first comment.

    I rarely nest data structures due to some of these cons that can outweigh the pros. If only items are desired, querying the items table directly (or a view based on foreign key structure) is an alternative.
Reply
  • The result of the query leaves you with a list of lists due to the nested multiple CDT. Dot notation nor the index function will be able to easily grab the items as a result. The way to get the information is to flatted the nested list as outlined by the first comment.

    I rarely nest data structures due to some of these cons that can outweigh the pros. If only items are desired, querying the items table directly (or a view based on foreign key structure) is an alternative.
Children
No Data