web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Business Central forum

Modify Item Inventory by REST-API

(0) ShareShare
ReportReport
Posted on by

I want to update the inventory by Items REST-Api provided from Business Central.

Allthough my User has SUPER user (with blank company and with example comany CRONUS),

3362.permissions.png

I still lack permissions and get following error:

{
    "error": {
        "code": "Internal_ServerError",
        "message": "You do not have the following permissions on TableData Item Ledger Entry: Insert.\r\n\r\nTo view details about your permissions, see the Effective Permissions page. To report a problem, refer to the following server session ID: '55895'."
    }
}


So I guess its not possible by this Interface as long as this interface doesnt support it. Is there another possibility?

I have the same question (0)
  • LSanderDK Profile Picture
    80 on at

    You need to create a object with the permissions to create records in item ledger enties.

    But it is bad practice to create item ledger entry..

    A better way is using the item journal and posting throw there

  • Community Member Profile Picture
    on at

    Thanks for letting me know theres a better way doing that by inserting items in item journal.

    However, my problem is not solved this way (since I want to do acccomplish this by the provided REST-Interfaces).

    According to docs.microsoft.com/.../dynamics_journalline, you cant pass an item nor an quantity to that Interface.

    So I guess its not possible?

  • LSanderDK Profile Picture
    80 on at

    You can create a codeunit with the required permission and with the parameter want/need, and publish it as a webservice.

    Then you can do this, but you need to do some development i NAV/BC.

    So it is possible, yes.

  • Community Member Profile Picture
    on at

    Is it also possible without some Development in BC?

  • LSanderDK Profile Picture
    80 on at

    Not to my knowledge.

    I do not think it ever will, because it not the correct way of handling data.

  • Community Member Profile Picture
    on at

    Thanks! Well you talk about the item interface. But through the journal interface it would be allright you said?

    And in the future the journal lines interface might be extended and will be capable of doing that.

    Or it might be possible to post the sales order in future, which would achieve the same.

  • Verified answer
    Community Member Profile Picture
    on at

    For future persons end up here. Its possible without additional development.

    1. Create Sales Invoice (POST /businesscentral/companies({id})/salesInvoices)
    2. Create Sales Invoice Line (POST /businesscentral/companies({id})/salesInvoices({id})/salesInvoiceLines)
    3. Post Sales Invoice by Using action (POST /businesscentral/companies({id})/salesInvoices/Microsoft.NAV.post)

    The last step updates/books the item.

    I found this action by looking at the metadata document found at




  • Community Member Profile Picture
    on at

    Not sure about this now, any updates?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans