Skip to main content

Notifications

Announcements

No record found.

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

Web Services for Purchase Invoice Matched to a Receipt

Posted on by Microsoft Employee

Hello,

I need to find which Web Service to use to create a Purchase Invoice linked to a Receipt.

So in NAV, you create the PO, receive and post the Receipt.

Then in Purchase Invoice, you create a purchase invoice and on the line, choose "Functions" >> "Get Receipt Lines" and it pulls in the receipt lines.  I need to do this process but using one of the Web Services.  The Purchase Invoice Web Service - Page 51, and any others I have found, do not have the Receipt Number and Receipt Line fields for me to send the Receipt information over.

Is there another Web Service that I can use to do this process?

I would really appreciate any help!

Thank you,

Heather Scovell

  • Babin Profile Picture
    Babin 2,947 on at
    RE: Web Services for Purchase Invoice Matched to a Receipt

    Hi Zhu, I have a codeunit "Purch.-Get Receipt" exposed as a web service. Do you know how it can be called from the postman? I am trying to do this from postman to test if that is possible?

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,696 Super User 2024 Season 2 on at
    RE: Web Services for Purchase Invoice Matched to a Receipt

    Hi, Maybe you can try to expose a procedure as an OData V4 web service action.

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-creating-and-interacting-with-odatav4-bound-action

    https://robertostefanettinavblog.com/2019/02/25/bound-actions-in-dynamics-nav-business-central/

    Hope this helps.

    Thanks.

    ZHU

  • Babin Profile Picture
    Babin 2,947 on at
    RE: Web Services for Purchase Invoice Matched to a Receipt

    Hi SvenB,

    Were you accomplish this task? I need to do exactly what you were trying to do here.

    Do you mind to share some info/notes you have for this. Thank you!!

  • SvenB Profile Picture
    SvenB 60 on at
    RE: Web Services for Purchase Invoice Matched to a Receipt

    Hi Josh,

    I exposed the codeunit as a web service. But can't figure out how to format the HTTP call to make it work. Can you give some pointers in regards to the parameters in the URL and the http body of the request.

    Thanks.

  • Suggested answer
    JAngle Profile Picture
    JAngle 33,159 on at
    RE: Web Services for Purchase Invoice Matched to a Receipt

    The "get receipt lines" process is controlled by a codeunit called "Purch.-Get Receipt". You could publish that codeunit as a web service. The parameter for it is a purchase line. Might be you have to recreate the codeunit to meet your needs as you won't be passing as much data as a whole record unless you do this via the data from page 51.

    Not a complete answer but hopefully a step in the right direction.

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans