WINDOWS Live Search

To contact me for any clarifications regarding any posts / information, please mail me at arijit [dot] basu [at] gmail [dot] com


Sunday, April 15, 2007

New Number Sequence for new AX Module

Sometimes back I had posted about creating new Numbersequences for existing AX Modules. However say someone wants to create a new module in AX and wants the same setup /Parameters form in the new module just like AX base modules. Say you want to create a new module called Pre Purchase, and for simplicity, we will create just 1 new Number sequence. Here’s what to do:-

1. Edit the baseEnum NumberSeqModule, adding a reference for your new module (Pre Purchase)


2. Create a new EDT say PurchaseRequisitionId which will be used in the module

3. Create new class NumberSeqReference_PrePurchase that extends NumberSeqReference

The 3 methods in that class are:

public class NumberSeqReference_PrePurchase extends NumberSeqReference

{

}

protected void loadModule()

{
NumberSequenceReference numRef;

;

/* Setup PurchaseRequisitionId */

numRef.dataTypeId = typeid2extendedtypeid(typeid(PwC_PurchaseRequisitionId));
numRef.referenceHelp = literalStr("Unique key for Purchase Requisition identification. The key is used when creating new Purchase Requisitions."); // Use Labels here
numRef.wizardContinuous = true;
numRef.wizardManual = NoYes::No;
numRef.wizardAllowChangeDown = NoYes::No;
numRef.wizardAllowChangeUp = NoYes::No;
numRef.sortField = 1;
this.create(numRef);
}

static NumberSeqModule numberSeqModule()

{
return NumberSeqModule::PrePurchase;
}

4. Modify the NumberSeqReference Class for the following methods

\Classes\NumberSeqReference\moduleList

Add the following code

// PrePurchase Begin

moduleList += NumberSeqReference_PrePurchase::numberSeqModule();

// PrePurchase End

\Classes\NumberSeqReference\construct

   Add the following code   

// Pre Purchase addition begin

case (NumberSeqReference_PrePurchase::numberSeqModule()): return new NumberSeqReference_PrePurchase(_module);

// Pre Purchase addition end

 5.       Look at existing Parameters Forms in AX

\Forms\LedgerParameters

6. The final Output

Happy DAX-ing

5 comments:

Zubair Ahmed said...

Very helpful, finally I was able to create my own Number sequence for my own module... :)

Zubair Ahmed said...

Very helpful, finally I was able to create my own number sequence...

Anonymous said...

as given i have created my new edt,table,forms,class and i have done with all my basic necessecities but can anyone tell me how to give the parameter values
in the form method numseqformhandler..

Dodge

Dodge said...

Useful Information given..
With this help i have created my Own Number Sequence for my own Module..But i have one problem that is when i run my parameter form it is fetching the number sequence references from all the modules...can anyone give me an idea of how to display the references meant for my new module alone...

Anonymous said...

Thank you very much for your post. This is exactly what I am looking. It works the first time I tried it.

Thank you, Thank you