0

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.

Mohd Saddaf khan
  • 289
  • 2
  • 14
  • 26

2 Answers2

1

You have to tick the

Continuous

in Number sequence screen > Tab General

dArc
  • 342
  • 1
  • 8
0

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.

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
  • Bad thing to do, as you will have save the number somewhere. But if you insist then dive in the methods of `NumberSeqFormHandler` to see what they do. – Jan B. Kjeldsen Jun 12 '13 at 06:22