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

Announcements

No record found.

News and Announcements icon
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)
  • 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.

  • 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

    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

    thanks! worked

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,958 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,101 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans