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 :
Small and medium business | Business Central, N...
Answered

Adjusting inventory using in an extension

(0) ShareShare
ReportReport
Posted on by 487

Hi Everyone,

Is there any information for business central (or microsoft nav) on how to properly adjust inventory of an item using code?

I found an adjust inventory codeunit, but it is not clear how/if it should be used.

Any information would be greatly appreciated.

Regards

HD

I have the same question (0)
  • Hedi Daneels Profile Picture
    487 on at

    thanks! worked

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    You need to fill an Item journal Batch (like page Item Journal, ID 40) and then run Item Jnl.-Post codeunit.

    I suggest to open page 40 and check the code under the Post action.

  • Hedi Daneels Profile Picture
    487 on at

    Hi,

    Do you have any information on how to do that? I saw the item journal table, but are there procedures to post?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Inside the D365BC application, when you calculate the inventory for an item you have the calculated quantity (calculated from the system) and the real quantity (manual field inserted by the end user accordingly to what he checks into the warehouse). When those 2 fields are different and you post the record, D365BC creates the positive/negative adjustement for you.

    If instead you want to create adjustements from the outside, recommended way is to create a codeunit that writes into the Item Journal Line table and then perform the posting.

    For example, if for Item X you have inventory = N and instead you want to have N-1, just create a negative adjustement of 1 into Item Journal Line (for the item and the location) and post it.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,476

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 789 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 719 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans