Skip to main content

Notifications

Announcements

No record found.

Business Central forum
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

Categories:
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 69,639 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,023 Moderator 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,744 Moderator 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,744 Moderator 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans