How to Create Number Sequence in the D365 X++ ?
If you want to create the number sequence in the D365 X++, Kindly follow the following steps:
1- Create a Project of D365 F&O with your model as shown below,
2- Create an Extended Data Type (EDTs) in the Project.
3- Now create a class of number sequence as shown below code;
protected void loadModule()
{
NumberSeqDatatype datatype = NumberSeqDatatype::construct();
datatype.parmDatatypeId(extendedTypeNum(EDTs));
datatype.parmReferenceHelp(literalStr("Unique key used for the Id."));
datatype.parmWizardIsContinuous(false);
datatype.parmWizardIsManual(NoYes::No);
dataType.parmWizardHighest(999999);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmSortField(1);
datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
this.create(datatype);
}
public NumberSeqModule numberSeqModule()
{
return NumberSeqModule::Cust;
}
[SubscribesTo(classstr(NumberSeqGlobal),delegatestr(NumberSeqGlobal,buildModulesMapDelegate))]
static void buildModulesMapSubsciber(Map numberSeqModuleNamesMap)
{
NumberSeqGlobal::addModuleToMap(classnum(main class name), numberSeqModuleNamesMap);
}
4- Call the above class in the main method or via the menu button as shown below;
public static void main(Args _args)
{
mainclassname mainclassname = new mainclassname ();
mainclassname .load();
}
Comments