Type Here to Get Search Results !

Guide to create Number Sequence In D365FO Using X++

 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();

    }

 

}


Step 7

Right Click on Runnable Class(Job) Set as Startup Project

Step 8

Right Click on Project Click on Rebuild 

Step 9

Click on Start.

Step 10

Now Click on Organization Administration & Click on Number Sequence

Follow below Image



Step 11

Click on Generate & Click on Next,Next




 Step 12 

Click on Account Receivable & Click on Example Monitor


Successfully Generated Number Sequence :)

Follow Below Video For Better Understanding

Microsoft D365 F and O Interview Questions




If you liked this Post, please subscribe to our You Tube channel, like and share  

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.