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 430

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

  • Verified answer
    WillWU Profile Picture
    22,352 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,280 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,046 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans