Working with numbersequences – New Module

  • February 16, 2010
  • 0 Comments

In a previous post I explained how to create a new Number Sequence in a existing module (Working with numbersequences – new NumberSequence). In this post I will explain how you can create a new Number Sequence-module.
I will create a new module called TEST (lack of inspiration).

Step-By-Step:

  • First of all extend the existing Enum ‘NumberSeqModule’ with a new value ‘TEST’ and enter the name of the module in the Label-property
  • create a new class called ‘NumberSeqReference_TEST‘ and that extends from ‘NumberSeqReference‘.
  • Add a static method called ‘numberSeqModule’ and return the new value of the Enum.
    public static NumberSeqModule numberSeqModule()
    {
        return NumberSeqModule::TEST;
    }
  • Override the Method loadModule and enter the necessary code for all the Number Sequences in your new module.
    protected void loadModule()
    {
        NumberSequenceReference numRef;
        ;
        /* TEST */
        numRef.DataTypeId               = typeId2ExtendedTypeId(typeid(TEST));
        numRef.ReferenceHelp            = literalstr("@SYS31561");
        numRef.WizardContinuous         = false;
        numRef.WizardManual             = NoYes::No;
        numRef.WizardAllowChangeDown    = NoYes::No;
        numRef.WizardAllowChangeUp      = NoYes::No;
        numRef.WizardHighest            = 999999;
        numRef.SortField                = 1;
     
        this.create(numRef);
    }
  • In the class NumberSeqReference, you have to add some new lines so the system recognizes your new module. Complete the method construct & moduleList.

  • Open the NumberSequence-form under BASIC – SETUP – NUMBER SEQUENCES – NUMBER SEQUENCES
  • Open the Number Sequence-wizard
  • Follow all the steps of the wizard and finish

     
  • See how the new Number Sequence in the Number Sequence-form

From now on you can use your new Numbersequence and the module.