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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

How to post invent transfer journal through x++ in d365 f&o

(0) ShareShare
ReportReport
Posted on by 4

Hello everyone,

I want to post transfer journal through x++.

but I tried some code but they didn't work for 365f&o

can anyone help me out.

Thanks 

siddy

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    moved to the d365 forum

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi siddy,

    Can you share what you already tried doing and any error messages / things that did not work.

    Many thanks,

    Ludwig

  • Siddy Mujumdar Profile Picture
    4 on at

    thanks for reply

    in search i am getting this code only but in 365 return type journal check post so i am not getting what to do.

    inventJournalCheckPost =

    InventJournalCheckPost::newJournalCheckPost

    (JournalCheckpostType::Post,inventJournalTable);

    inventJournalCheckPost.parmThrowCheckFailed(_throwserror);

    inventJournalCheckPost.parmShowInfoResult(_showinforesult);

    inventJournalCheckPost.run();

    inventJournalTable.SystemBlocked = false;

    inventJournalTable.update();

  • Verified answer
    Syed Zeeshan Haider Jafry Profile Picture
    725 on at

    Hi Siddy,

    You can try below code snippet.

    public static server void postJournal(InventJournalTable   _journalTable, boolean _deleteJournalIfErrors = true, boolean _showInfo = true)
        {
        
            JournalCheckPost        journalCheckPost;
            ;
        
            if(InventJournalCheckpost::newPostJournal(_journalTable).validate())
                    journalCheckPost = InventJournalCheckPost::newPostJournal(_journalTable);
        
            if (InventJournalTrans::lastLineNum(_journalTable.JournalId) == 0)
            {
                _journalTable.delete();
            }
            else
            {
                if(journalCheckPost.validate())
                {
                    try
                    {
                        if (!_showInfo)
                        {
                            journalCheckPost.parmThrowCheckFailed(false);
                            journalCheckPost.progressHide();
                            journalCheckPost.parmInBatch(true);
                            journalCheckPost.parmShowInfoResult(false);
                        }
                        journalCheckPost.run();
                    }
                    catch
                    {
                        //Deletes the InventJournalTable table, the InventJournalTrans will auto delete because of the Delete actions.
                        if (_deleteJournalIfErrors)
                            _journalTable.delete();
                    }
                }
            }
        }
    

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…

Neeraj Kumar – Community Spotlight

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

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 307 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 123 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 67 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans