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

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to create Voucher number while inserting into inventJournalTrans

(0) ShareShare
ReportReport
Posted on by 74
Hi All, 

     I am  inserting records into "inventJournalTrans" in batch job, but i am stuck at how to create voucher number while inserting records into inventJournalTrans table.
Any help or suggestion. The is my code.
 
InventJournalTrans inventJournalTrans;
EntAssetParameters parameters  = EntAssetParameters::find();
JournalTableData    journalTableData;
JournalTransData    journalTransData;
inventJournalTrans.clear();
inventJournalTrans.initValue();
inventJournalTrans.initFromInventJournalTable(EntAssetWorkOrderTableJournals::findOrCreateInventJournalTable(_workOrderTable.RecId));
inventJournalTrans.TransDate = DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone());   
   
inventJournalTrans.EntAssetWorkOrderLine = _workOrderLine.RecId;
inventJournalTrans.ProjCategoryId = parameters.ItemCategory;

  //  inventJournalTrans.Voucher =
inventJournalTrans.JournalId = _inventJournalTable.JournalId;
inventJournalTrans.ItemId = _stagingLine.ItemId;
inventJournalTrans.Qty    = _stagingLine.Qty;
inventJournalTrans.insert();
 
Categories:
I have the same question (0)
  • Diego Mancassola Profile Picture
    597 on at
    Hello, what's your business requirement to do that?
     
    Tipically you don't have to set the voucher, the system set it for you based on journal name settings.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 680 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 370 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 331

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans