x++


Number sequence issue Ax 2012?


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.
You have to tick the
Continuous
in Number sequence screen > Tab General
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.

Related Links

How to force/format two decimal places
Regarding X++ query
MultiSelectionHelper not working as expected
Sorting by custInvoiceJour.Dimension
Refresh the main screen in ax dynamics 2009
How to insert into a table field with value from a display method dependent of string
x++ cannot read registry entry
How do I get the caller Form's name in the Insert() of a table in AX 2012?
How to lookup into another table using EDT AX 2012
Set a Date Value to a Date Field in AX2012
Determine if a job is running in X++ code
Dynamics AX 2012 parsing Int32 to table field integer
Cancel Sales order packing slip through x++
Transferring open account records between customers
How to make sure that a form is only opened once?
Extend system menu in Dynamics AX 2012?

Categories

HOME
checkstyle
time-complexity
object
saml-2.0
google-cloud-functions
static-site
permissions
telegram-bot
pyqt4
zip
nuget-package
nstableheaderview
performancepoint
accessibility
g++
minecraft-forge
commonjs
fhir
mel
ycsb
radgridview
shared-libraries
android-intent
altera
screen-readers
dimensional-modeling
google-picker
charles
object-storage
tosca
flask-sqlalchemy
resourcebundle
moses
maze
opentk
android-sharedpreferences
licensing
gojs
least-squares
imagenet
linq-to-objects
demo
doc
datacachefactory
contract
drupal-theming
fwrite
term
spring-integration-sftp
yii2-user
git-flow
boo
py2neo
choice
usart
file-uri
watch-os-2
model-associations
highland.js
assertion
dulwich
pyobjc
shopizer
android-cookiemanager
raygun
ora-00904
mintty
cancellation
xml-dsig
tinyxml
multiautocompletetextview
conditionaltagsupport
android-audiorecord
spring-3
neos-server
facebook-timeline
diem
iboutlet
objectquery
box2d-iphone
google-maps-mobile
rmdir
globals
jqueryform
web-garden
scrollbars
dojo-dnd
sqlobject

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App