Number seq is skipping how to control in Ax 2012 R3

Hi ,

I created a number sequence in the form using numberSeq class in ax 2012 r3.

It is creating number sequence perfectly.

But the problem raised after deleting the record without saving the record.i.e., pressing the Esc Key.

After that creating a new record generates new number rather than the deleted number.

Eg :1. CTRL+N => record “001” is created

  1. Delete “001” without saving using (Esc key).

  2. CTRL+N => record “002” is created

  3. But I want to generate 001 only.

Below is the code for generating

numSeqCode = EcoResCategory::find(recid).USMFNumberSequenceCode;
num = NumberSeq::newGetNumFromCode(numSeqCode); // Parameters Table
itemid = num.num();

Please help me!!!

Thanks in advance

Have you tried by setting it to continuous?

Hi Rajendra. You have to create methods at form level. Follow below blog…/
Also keep continuos as said Kranthi

Yes I tried but I’m getting an error like Number seq cannot be continous

I think you are not allowing the continuous option on your NumberSeqModule* class.

Check the status list of that Number sequence…

This may helpful to you

I have checked with continous option still New number seq is coming

What other code do you have on the form related to this number sequence?
You may probably need to call the num.abort(); in form close and form data source delete methods - if the record is not created.