Guide create Number Sequence In D365FO Using X++
To create readable, distinctive IDs for master data records and transaction records that need them, number sequences are utilized. A reference is a record of master data or a transaction that needs an identification.
A number sequence must be established and linked to a reference before you may add additional entries for it. Organization administration pages to build up number sequences. If module-specific settings are necessary, you can utilize a module's parameters page to define the number sequences for its references. As an illustration, consider accounts payable and receivable.
Step by step to create Number Sequence In D365FO Using X++
Step 1 :
Create Model
Click here to Know : How to create Model
Step 2
Create Table
Click here to Know : How to create Table
Step 3
Create Form
Click here to Know : How to create Form
Step 4
Create Menu Items & Menu
Click here to Know : How to create Menu Items & Menu
Step 5
Create Class
Example : MonitorIdNumSeq
Write Below Code
class MonitorIdNumSeq extends NumberSeqApplicationModule
{
protected void loadmodule()
{
NumberSeqDatatype datatype = NumberSeqDatatype::construct();
datatype.parmDatatypeId(extendedTypeNum(MonitorId));
datatype.parmReferenceHelp(Literalstr("Monitor Id"));
datatype.parmWizardIsContinuous(true);
datatype.parmWizardIsManual(NoYes::No);
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 buildModuleMapSubscriber(Map _numberseqModuleNameMap)
{
NumberSeqGlobal::addModuleToMap(classNum(MonitorIdNumSeq),
_numberseqModuleNameMap);
}
}
Step 6
Create Runnable Class(Job)
Write Below Code
class MonitorIdJob
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified
arguments.</param>
public static void main(Args _args)
{
MonitorIdNumSeq
MonitorIdNumSeq = new MonitorIdNumSeq();
MonitorIdNumSeq.load();
}
}
Microsoft D365 F and O Interview Questions