0
votes

I have created a New number sequence named 'MyNumberSeq' using Number sequence form under Organization administration Module in AX 2012. Now, I am using this number sequence in a form in some static field let's say 'MyNumberseqField' in Form 'MyForm' that will save the record in a table after pressing save button. If I am creating a new record, it is getting the number sequence in a specified field and data gets saved if I press Save button. I am fetching number sequence as

MyNumberseqField.text(numberSeq::newGetNumFromCode("MyNumberSeq").num());

But My issue arises when I am closing this form by pressing cancel or by pressing Esc button(Let's say Number seq generated is MD-00001). Logically Number sequence which was generated should get free on this action. The form closes as any normal form, Now if am opening this form again to create new record, New number seq (MD-00002) gets generated instead of previous unused number MD-00001. Please suggest any solution for this or any other alternate way to create Number seq.

2

2 Answers

1
votes

You have to tick the

Continuous

in Number sequence screen > Tab General

0
votes

Your form works as I would expect! The reuse of unused numbers requires special treatment which your form fail to do.

As explained in the Number Sequence Framework, use the NumberSeqFormHandler class to control the acquisition and release of numbers.