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 :
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,361 on at
    RE: Create Production Picking List Journal through code in D365

    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…

Abhilash Warrier – Community Spotlight

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

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 413

#2
Sagar Suman Profile Picture

Sagar Suman 198 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans