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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Invent Journal Trans quantity not updating quantity in transactions

(4) ShareShare
ReportReport
Posted on by 55
Ok so I have this api, in the request body i send an updated qty for the lines of a Transfer Journal. the quantity gets updated successfully, but when i go look into the inventory transactions for that item and search it with that journal id, the quantity remains same as before.

But when i do this process directly from dynamics. If i update the quantity of the line, lets say it was -5 before, i change it to -7 and save it on the form, then if i refresh the inventory transactions, the quantity of it also changes accordingly.

I have attached relevant screenshots and the code, Kindly help.

if (_InventJournalTrans.UnitQty != _currLine.parmQty() * -1)
{
    //ttsbegin;
    ////inventJournalTrans.modifyInventJournalTransUnitQty(inventJournalTrans.Unit);
    //_InventJournalTrans.selectForUpdate(true);
    ////_InventJournalTrans.Qty = _currLine.parmQty() * -1;
    ////_InventJournalTrans.UnitQty = _currLine.parmQty() * -1;s
    //_InventJournalTrans.Qty = _currLine.parmQty() * -1;
    //_InventJournalTrans.editUnitQty(true,  _currLine.parmQty() * -1);
    //_InventJournalTrans.Notes = _currLine.parmNote();
    //_InventJournalTrans.modifyInventJournalTransQty();
    //_InventJournalTrans.update(NoYes::Yes);
    //ttscommit;
    ttsbegin;
    _InventJournalTrans.selectForUpdate(true);
    _InventJournalTrans.Notes = _currLine.parmNote();
    _InventJournalTrans.editUnitQty(true, _currLine.parmQty() * -1);
    _InventJournalTrans.modifyInventJournalTransQty();
    _InventJournalTrans.doUpdate();
    ttscommit;
}


Categories:
I have the same question (0)
  • Suggested answer
    Anton Venter Profile Picture
    20,848 Super User 2026 Season 1 on at
     
    Without investigating and testing your exact scenario, I can give you a hint why it's probably not working from code.
     
    I see you are using the doUpdate method instead of the update method on the InventJournalTrans table buffer in your code. Why is that?
     
    Calling doUpdate on the table buffer skips the code in the update method of the table and just updates the data in your table buffer. Usually speaking you should always call the standard insert, update and delete methods so that any logic present will be triggered. In some rare cases you might want to call doInsert, doUpdate or doDelete that but this is certainly a case where you don't want to.
     
    When you are in F&O in a form and changing data manually and the data is saved, the system calls the update method of the datasource so that any business logic present may be triggered.
     
    Screenshot of InventJournalTrans update code

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 410 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 390

#3
Martin Dráb Profile Picture

Martin Dráb 262 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans