Set up a new number sequence (e.g. for Blanket Orders)

  1. New Data Type
  2. Add a new SalesParameters method:

    static client server NumberSequenceReference  numRefSalesIdBlanket()
    {
        return NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(SalesIdBlanket)));
    }

  3. Assign SalesId in the somewhere during the creation of the blanket order:

    salesTable.SalesId = NumberSeq::newGetNum(SalesParameters::numRefSalesIdBlanket()).num();

  4. Add new reference to NumberSeqReference_SalesOrder class (used to add the new number sequence to the list in the CustParameters form)

    protected void loadModule()
    {
        NumberSequenceReference numRef;
        ;
    //blanket order number sequence
        numRef.DataTypeId              = typeId2ExtendedTypeId(typeid(SalesIdBlanket));
        numRef.ReferenceHelp           = literalstr("@SYS53960");
        numRef.ReferenceLabel          = literalstr("@CUS525");
        numRef.WizardManual            = NoYes::No;
        numRef.WizardAllowChangeDown   = NoYes::No;
        numRef.WizardAllowChangeUp     = NoYes::No;
        numRef.SortField               = 1;
        this.create(numRef);
        …
    }

  5. Set up the new number sequence in the customer parameters form.

Done.