Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

how to get both header and line from single API call?

Posted on by 62

hello Guys,

I have created Custom API Page for Header and Custom API Page for Line of Purchase Header.

Also I have added Part( Line,"Custom API Page for Line") with EntityName in Custom API Page (header). 

When I am calling  Custom API Page for Header only get Header data not getting Line data in Result.

 

Guide/ Help me here,

Thanks in Advance

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,110 Super User 2024 Season 2 on at
    RE: how to get both header and line from single API call?

    Hi, you can just use $expand.

    For example, api.businesscentral.dynamics.com/.../salesOrders?$expand=salesOrderLines

    More details: https://yzhums.com/6117/#toc13

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    Amit Baru Profile Picture
    Amit Baru 3,025 on at
    RE: how to get both header and line from single API call?

    Hi,

    Pls share your code.

    Regards

    Amit Sharma

    www.erpconsultors.com

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: how to get both header and line from single API call?

    Hi,

    Please refer the below link, it has a good examples

    www.kauffmann.nl/.../

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: how to get both header and line from single API call?

    You can find that source code here:

    github.com/.../pages

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: how to get both header and line from single API call?

    Havee you tried to compare your code with the standard API for purchase orders?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,963 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans