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

    }

5- Now build and synchronize the project.

6- Go to the front-end site of F&O and run the class.

7- Go to account receivable parameters and go to the number sequence tab in the Account receivable module.

8- In the Number Sequence tab, Your EDTs are shown at the last.

9- Set the Number Sequence Code to your Number sequence.

10- Now you can use these EDTs as a number sequence on any form.

If you have any ambiguity or confusion, Kindly drop a message. We always welcome you to help with this. 










Comments

Popular posts from this blog

Create custom workflow in D365 X++

Convert amount from one currency to another currency using X++

How to Create Extended Data Types (EDTs) in Finance and Operations of Dynamics 365 -- F&O Customization Part 2