How to post a pickinglist journal using x++ code

Hi all,

I’ve created Pickinglist journal using Prod id, itemid, bom unit, bom consump, inventory dimensions

I’ve some doubts …

Is it necessary to give proposal value?

How could I post my journal through x++?

Thanks in advance


Use \Classes\ProdJournalCheckPostBOM

When I try to post using code I’m getting error as


But i when post manually it’s getting posted…

My form is

My coding is

 while select forupdate pjttmp where pjttmp.TransactionStatus  == ProdJournalTableTempStatus::Post
            prodJournalCheckPostbom= ProdJournalCheckPostBOM::newPostJournal(pjttmp.JournalId,true);
            pjttmp.TransactionStatus =ProdJournalTableTempStatus::Posted;
            pjttmp.PostedDateTime = datetimeutil::utcNow();

How is the journal created when posted manually and using code?

Also check, if the \Data Dictionary\Tables\ProdJournalBOM\Fields\InventConsump is updated properly.

No, Kranthi.

InventConsump isn’t filled Kranthi for that prodid…

How can we fill that?

I created the journal by passing necessary field values from temp table to prodjournalbom table

It is equivalent to BomConsump in inventory unit. Convert BomConsump to quantity in inventory unit and assign that value to InventConsump.

For reference see, \Classes\ProdJournalFormTransBOM\fieldModifiedBomUnitIdPost

like that is it any class for InventProposal field value, kranthi?

You can assign InventConsump value to InventProposal and BomConsump value to BomProposal


prodJournalBOM.BomProposal= prodJournalBOM.BomConsump;
prodJournalBOM.InventProposal = prodJournalBOM.InventConsump;

Is it necessary to update BOM qty and QtyBOMCalc fields in ProdBom table for pickinglist journals?

Not necessary. The insert() on prodJournalBOM will handle it.

But when i check the values in prodbom table for my journal id those fields are empty, kranthi

How was the ProdBOM created? Try creating a new production order and check.

Do you still get the error after updating the InventConsump ?