Creating new NumberSequences in AX (Existing Modules)
Suppose you have created a new Form (Employee) in HRM Module and want to set up NumberSequences on that form.
Here is what you do:1. Create a new EDT called mk_empNumEDT.
2. Create a Table mk_EmployeeTable using this EDT.
3. Create a relation on the EDT.
4. Append \Classes\NumberSeqReference_HRM\loadModule() method and add the following code at the end
//==========================================numRef.DataTypeId = typeId2ExtendedTypeId(typeid(mk_empNumEDT)); // The new EDT you madenumRef.ConfigurationKeyId = configurationkeynum(Your Config Key); // Any Configuration key you madenumRef.ReferenceHelp = literalstr("Your label."); // Label you want to appear on the Parameters FormnumRef.WizardContinuous = true;numRef.WizardManual = NoYes::No;numRef.WizardAllowChangeDown = NoYes::No;numRef.WizardAllowChangeUp = NoYes::No;numRef.SortField = 12; // Sorting on the Parameters FormnumRef.WizardHighest = 999999;this.create(numRef);//==========================================
5. Goto \Basic\Setup\Number sequences\Number sequences and create a new record.
6. Goto \Menus\Basic\Setup\Number sequences\References and select Number sequence code created in step 5.
7. Create a new Method in the mk_EmployeeTable created.\Data Dictionary\Tables\newTable\Methods\ initValue ()
//==========================================public void initValue()
{
this.EmpNum = NumberSeq::newGetNum(NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(mkEMPNum)))).num();
// this.EmpNum = NumberSeq::newGetNumFromCode('Huma_136').num();// second option we can use.
super();
}//==========================================
8. Create a form and add this table to data source and use it.
This Blog contains information regarding Dynamics AX 365 Finance and Operations AX (Axapta) Development and code that is frequently used. You can post any type of Queries related X++,EP, SSRS and AIF.
Subscribe to:
Post Comments (Atom)
Import and Export file from BLOB storage Account(Azure) in D365 F&O using X++
Import and Export file from BLOB storage Account in D365 F&O using X++ Import: /// <summary> /// MKInventQualityOrderLineService...
-
In the below example we will see how we can get the default financial dimension values from Purch line table. Here we are using AxdDimensi...
-
It is very common to use Like Operator in SQL SELECT column1, column2, ... FROM table_name WHERE columnN LIKE pattern ; N...
-
Get temp data from class to form Data source AX 2012 + X++ In the below example we will see how we can use the temporary table as form da...
No comments:
Post a Comment