Creating new numbersequence in AX 2012

Hi

Would anybody please tell me…How to create a new number sequence in ax 2012.

I tried like this…1.Created a New EDT(String Type)

2.Added code in Load Module() of NumberSeqModuleHRM - class

3.Added code in HrmParameters - Table…New method

4.Wrote a Job to initiates NumberSeqModuleHRM class and call the loadModule method

But it doesn’t worked .

Please Help me in Identifying where i went wrong…

Thanks in Advance

Number Sequence Creation:

Here I want to design a form named FirstForm with DataSource FirstTable

I want to create sequence like “AX00001---------AX99999”.

Step 1

Create an EDT - String Type

So, I created an EDT named “AXSeqEDT” with label “AX Seq”

Drag into Table(FirstTable)àFields

Step 2

Now create a new Number Sequence

Path for creating num Sequence is

“Module:: Organization administration…Common…Number sequences…Number sequences”

Click on New(Number Sequence)

Now number Sequence form will be opened----That contains 4 sections.

Section 1.Identification…Specify the NumberSeqCode and Name

Section 2.Scope Parameters… Select the Scope from the Dropdown

Section 3.Segments… Add the constant and alphanumeric (by clicking the add button and selecting from drop down)

Section 4 .General…Checkmark for continous and Specify the “smallest and largest and Next” Fields

Now Save Ur Settings

Step 3

Now add the Respective manual-code to class - NumberSeqModuleURMODULE

And Table - URMODULEParameters.

So I am creating number sequence based on HRM Module…So iam using class NumberSeqModuleHRM and Table HRMParameters

Now go to AOT—Classes-NumberSeqModuleHRM—loadModule()

Add the code here…

Note::Here we can add the code seeing the existing implementation

The Added Code is::

/* setup discussion number sequence - it is global */

datatype.parmDatatypeId(extendedtypenum(AXSeqEDT));

datatype.parmReferenceHelp(literalstr("@SYS32633"));

datatype.parmWizardIsContinuous(true);

datatype.parmWizardIsManual(NoYes::No);

datatype.parmWizardIsChangeDownAllowed(NoYes::No);

datatype.parmWizardIsChangeUpAllowed(NoYes::No);

datatype.parmWizardHighest(99999);

datatype.parmSortField(12);

this.create(datatype);

Now Goto AOT—Tables—HRMParameters—methods-----click on new method

Add the code In the New method

Note::Here we can add the code seeing the existing implementation

The Added Code is

static client server NumberSequenceReference numRefAXSeqEDT()

{

return NumberSeqReference::findReference(extendedTypeNum(AXSeqEDT));

}

Step 4

In order to add our newly created number sequence reference to our Module write the following Job and Execute it

Below job is important to run because without it your new number sequence will not be available to number sequence form under Parameters. This is the change in behavior from AX 2009 where all new number sequence loads while restarting the Dynamic AX. In AX 2012 all the number sequence created to system while installation, so restarting the AOS wont effect in loading the new number sequence, that is why it is important to run the job to load new number sequences.

The Code added in The Job is

static void jobName(Args _args)

{

NumberSeqModuleHRM NumberSeqModuleHRM = new NumberSeqModuleHRM();

;

NumberSeqModuleHRm.load();

}

Step 5

After executing the Above Job, our newly created number Sequence reference “AX Seq” will be added to HRM Module----Number sequence setup form

Lets Check it

Now click on Number Sequence and Identify the newly created Number Seq Reference

After Identifying the Number Sequence Reference ----Allot the Number Sequence Code to the Number Sequence Reference…By selecting from the drop down list

Step 6

Now add the Code in Create method of Forms Datasource methods

Goto-AOT-Forms-FirstForm-Datasources-FirstTable-Methods-Override method(Create)

public void create(boolean _append = false)

{

;

super(_append);

FirstTable.AXSeqEDT = NumberSeq::newGetNum(HRMParameters::numRefAXSeqEDT(),true).num();

}

Step 7

Now save all ur settings…Now Open our form-FirstForm

http://dynamicsuser.net/forums/p/32430/170165.aspx-------For Further Ref—Use This Link

Hello,

Number sequence code is the best code with the steps you have described for creating Sequence number. Thanks for wounderful code and it is very easy to understand conceptually.

Thanks.

Himanshu

Not working…!!!

Hi,

Try this link : http://axaptacorner.blogspot.in/2012/09/generate-number-sequence_8531.html

Thanks
Lakshmi.

6661.Generate number Sequence in AX 2012.pdf (435 KB)