
Hi All,
Is there anyways to display Child records along with Parent Records using Web API in Business Central?
For example if my API returns data of Purchase Header we want its associated purchase lines to be displayed. Can anyone please suggest a way out?
Thanks in Advance
Hello,
I think that this article will help you:
docs.microsoft.com/.../devenv-develop-custom-api
Look for Example 4 and the example with the $expand parameter:
GET api.businesscentral.dynamics.com/.../companies(<company id>))/carBrands(<car brand id>)?$expand=carModels
It also depends on how the api page is designed but I think that the standard Purchase Order api will allow you to use $expand to get both header and lines in one call.