Hello,
I am developing a Business Central Integration that requires creating Inventory adjustments. I understand creating Item Journal entries is the best way to do this, but is not possible through the APIs. There is a codeunit (1327) that can adjust Item Inventory, but I am struggling to find documentation on how to use it. I have added the codeunit row to Web Services, given it a name, and have an API endpoint to use. I am getting
Thanks for the responses!
To clarify, I was only trying to create Item Journal Lines, not post them. I was referencing the MSFT's API documentation, which only discussed the standard APIs. I did not realize that you could expose an existing page from BC Web Services, and POST new lines through the generated API.
Exposing the Item Journals Page got me what I needed.
Thanks!
Depends on the procedure being used. Source code for the one I assume you might be trying is:
procedure PostAdjustmentToItemLedger(Item: Record Item; NewInventory: Decimal) LastErrorText: Text
I think the error is logical as a complete json representation of a rec value won’t be easy to replicate.
Might be better creating your own codeunit based off this one. So instance if you swap the Item parameter to be a code[20]. Add logic to find the item record from your provided code value. After that the rest of the code is fine
Why is it not possible to create item journal through API ?
You can create a new codeunit with function to create and post the journal, and call that function using API. We have done this a few times without no issue.
Sohail Ahmed
953
YUN ZHU
921
Super User 2025 Season 1
Mansi Soni
602