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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Same Number Sequence is Being Re-used Creating Duplicated Vouchers

(0) ShareShare
ReportReport
Posted on by 1,054

Hi dear community !

I'm facing a problem in my journals where the voucher number sequence of a previous journal is being re-used again in the next journal (Different journals, so it's not related to journal balance).

The voucher number sequence is set to “Countinuous = Yes”.

What I noticed is that after generating the 1st journal, when I click on the voucher number sequence status list (under “Administration” tab in action pane), I can see the already used voucher number is listed and its status is set to “Free”.

The code assigning the number sequence is a custom code

Here is the method code used to set the voucher number for the jorunal:

protected void setVoucherForJournal(JournalNameId _JournalNameId)
   {
       NumberSeq           numberseq;
       NumberSequenceCode  NumberSequenceCode;
   
       NumberSequenceCode = NumberSequenceTable::find(LedgerJournalName::find(_JournalNameId).NumberSequenceTable).NumberSequence;
       numberseq = NumberSeq::newGetVoucherFromCode(NumberSequenceCode);
       if(NumberSequenceTable::find(LedgerJournalName::find(_JournalNameId).NumberSequenceTable).Continuous == NoYes::No)
       {
           this.parmVoucher(numberseq.voucher());
       }
       else
       {
           ttsBegin;
           this.parmVoucher(numberseq.voucher());
           ttsCommit;
       }
   }

Is there something wrong in the code that is making the new generated number sequence to be available in the status list as free?

What to do to prevent that?

 

Any advise is appreciated !

Thanks in advance !

Categories:
I have the same question (0)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 345 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 304

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans