0% found this document useful (0 votes)
244 views5 pages

Generate Number Sequence Using Chain of Command

Chain of command is used for extending Standard Table, Form and Class methods without customization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
244 views5 pages

Generate Number Sequence Using Chain of Command

Chain of command is used for extending Standard Table, Form and Class methods without customization.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Blog Content

Chain of Command

Chain of command is used for extending Standard Table, Form and Class methods without customizations.

Important Keywords:

next(), className_Extension

Here, gave an example for generating number sequence in Standard modules

STEP I:

Create DataType of String for generating number sequence.

Ex: PurchaseOrderSeqId

Rahul R
STEP II:

Key points is to end the name with “Extension” and use the ExtensionOf attribute.

Ex:

[ExtensionOf(classStr(NumberSeqModulePurchaseOrder))]

final class NumberSeqModuleCustomer_Extension

protected void loadModule()

next loadModule();

NumberSeqDatatype datatype = NumberSeqDatatype::construct();

datatype.parmDatatypeId(extendedTypeNum(PurchaseOrderSeqId));

datatype.parmConfigurationKeyId(configurationKeyNum(PurchOrder));

datatype.parmReferenceHelp(literalStr("Purchase order sequence number"));

datatype.parmWizardIsContinuous(false);

datatype.parmWizardIsManual(NoYes::No);

datatype.parmWizardFetchAheadQty(10);

datatype.parmWizardIsChangeDownAllowed(NoYes::No);

datatype.parmWizardIsChangeUpAllowed(NoYes::No);

datatype.parmWizardHighest(999999);

datatype.parmSortField(1000);

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

this.create(datatype);

Rahul R
STEP III:

Add a method that returns a reference to the number sequence. Best practice is to put the method on the module’s
parameters table.

Ex:

[ExtensionOf(tableStr(PurchParameters))]

final class PurchParameters_Extension

public static NumberSequenceReference numRefPurchaseOrderSeqId()

return NumberSeqReference::findReference(extendedTypeNum(PurchaseOrderSeqId));

NOTE: (try not to use classStr instead of tableStr)

STEP IV:

Create a Runnable class (JOB) to execute following code to generate the number sequence in module.

Ex:

class LoadNewDataTypes

public static void main(Args _args)

NumberSeqModulePurchaseOrder module = new NumberSeqModulePurchaseOrder ();

module.load();

info(“Number sequence is generated !!!”);

}
Rahul R
STEP V:

Go to Organization administration / Number sequence / Number sequence to create number sequence

Rahul R
Click Generate as highlighted below,

Click Next and select the number sequence for the companies.

Rahul R

You might also like