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

Create Production Picking List Journal through code in D365

(0) ShareShare
ReportReport
Posted on by 436

Hi Experts,

I want to create picklist journal through code in D365 and also I want to create this through release button of the production order.

Also generate the print picklist report.

Please suggest the right path to achieve the same.

Regards

Sona Jee

I have the same question (0)
  • Verified answer
    WillWU Profile Picture
    22,363 on at

    Hi Sona,

    Check the following code:

    static void PickingListJournal(Args _args)
    {
        ProdJournalTable    prodJournalTable;
        ProdJournalBOM      prodJournalBOM;
        ProdTable           prodTable = prodTable::find("POnumber");
    
        prodJournalTable.clear();
        prodJournalTable.initValue();
        prodJournalTable.JournalType    = ProdJournalType::Picklist;
        prodJournalTable.JournalNameId  = "nameid";
        prodJournalTable.Description    = "Description";
        prodJournalTable.ProdId         = prodTable.ProdId;
        prodJournalTable.VoucherDraw    = JournalVoucherDraw::Post;
        prodJournalTable.VoucherSeqRecId = NumberSequenceTable::find(ProdParameters::numRefProdJournalVoucherId().NumberSequenceId).RecId;
        prodJournalTable.insert();
    
        prodJournalBOM.clear();
        prodJournalBOM.initValue();
        prodJournalBOM.JournalId        = prodJournalTable.JournalId;
        prodJournalBOM.initFromInventTable(InventTable::find("..."));
        prodJournalBom.ProdId           = prodTable.ProdId;
        prodJournalBom.LineNum          = 1;
        prodJournalBom.InventDimId      = "...";
        prodJournalBom.TransDate        = systemDateGet();
        prodJournalBom.BOMUnitId        = "Pcs";
        prodJournalBom.BOMConsump       = 1;
        prodJournalBom.InventConsump    = 1;
        prodJournalBom.insert();
        ttsBegin;
        prodJournalTable.selectForUpdate(true);
        prodJournalTable.NumOfLines = 1;
        prodJournalTable.update();
        ttsCommit;
        info(strFmt("Journal %1 created",prodJournalTable.JournalId));
    }
    

    You could check the standard code in the createProdPickingListJournal method in the WHSProductionScrapHistory table.

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 305 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