axaptadynamics-ax-2012x++sequencesnumber-sequence

How to create a number sequence multicompany?


I need to create a custom number sequence, but another request It is to have a multicompany Number sequence.

I know how to create a simple sequence, I used this NumberSeq_Tutorial. It's possible to create a Number sequence in a company, launch the

JOB

static void loadNumSeqCustDemo(Args _args)
{
    //define the class variable
    NumberSeqModuleCustomer seqMod = new NumberSeqModuleCustomer();

    //load the number sequences that were not generated
    seqMod.load();
}

and after can use in all anorher company the same Number Sequence. It's possible ? I need to get a new Number sequence element whe I create e new record in by form.

Thanks in advice,

enjoy!


Solution

  • See how to Set up number sequences.

    On the Scope parameters FastTab, select the Shared scope for the number sequence.

    When initializing the number sequence do not call the addParameterType. Usually:

    datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
    this.create(datatype);
    

    Instead just:

    this.create(datatype);
    

    I found this Making a Number Sequence Shared in AX 2012 - Tutorial on web.