web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: Adjusting inventory using in an extension

    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
    RE: Adjusting inventory using in an extension

    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
    RE: Adjusting inventory using in an extension

    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
    RE: Adjusting inventory using in an extension

    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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,255

#2
Sumit Singh Profile Picture

Sumit Singh 2,665

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,401

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans