Notifications
Announcements
No record found.
Hi,
i have a test environment where users post many transactions in different modules. how can i reset related number sequences ?
*This post is locked for comments
Hi David,
It is possible to clear the status list (if continuous) and then change the next value to represent the first value. You cannot change the in-use field manually from the user interface. It would be possible to change it using a script or table browser.
Hi Andre,
thanks for you reply. So after i run class to delete transactions, i have to manually clear status list for every related number sequence?
By the way, class deletetrans doesn't clear all tables like pending vendor invoice (VendInvoiceinfotable). any idea?
thanks.
You can use following script to reset number sequence by passing the company name. Please test this code on your test environment before executing on actual.
Source: http://techemall.blogspot.com/2015/09/reset-number-sequence-ax2012.html
static void resetNumSeq(Args _args) { NumberSequenceTable numseqtab; info(curext()); changecompany ('test') // Specify company name here { ttsbegin; while select forupdate numseqtab { numseqtab.NextRec = numseqtab.Lowest; numseqtab.update(); } ttscommit; } }
There might be some updates for the delete transactions class, but not sure if this is also solved. If not, you can add your own tables to be included or excluded in the class.
The code provided by Chaitanya might also help you. Note that this does not take into account if the number sequence is linked to transactions or master data. Without adjustments it will reset also number sequences from the global address book, customers, products, etc which you probably will not delete.
Thanks Chaitanya and Andre,
@Chaitanya, as per Andre it will reset all number sequence including those related to master data; is there any way to reset transactions related number sequence?
@Andre, i should add my own tables to "handleNon Trans Table" within SysDatabaseTransDelete class?
I don't remember the correct method name, but it could be indeed the one you mentioned.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Priya_K 4
Martin Dráb 4 Most Valuable Professional
Ali Zaidi 2