Generate Number Sequence Using Chain of Command
Generate Number Sequence Using Chain of Command
Chain of Command
Chain of command is used for extending Standard Table, Form and Class methods without customizations.
Important Keywords:
next(), className_Extension
STEP I:
Ex: PurchaseOrderSeqId
Rahul R
STEP II:
Key points is to end the name with “Extension” and use the ExtensionOf attribute.
Ex:
[ExtensionOf(classStr(NumberSeqModulePurchaseOrder))]
next loadModule();
datatype.parmDatatypeId(extendedTypeNum(PurchaseOrderSeqId));
datatype.parmConfigurationKeyId(configurationKeyNum(PurchOrder));
datatype.parmWizardIsContinuous(false);
datatype.parmWizardIsManual(NoYes::No);
datatype.parmWizardFetchAheadQty(10);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmWizardHighest(999999);
datatype.parmSortField(1000);
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))]
return NumberSeqReference::findReference(extendedTypeNum(PurchaseOrderSeqId));
STEP IV:
Create a Runnable class (JOB) to execute following code to generate the number sequence in module.
Ex:
class LoadNewDataTypes
module.load();
}
Rahul R
STEP V:
Rahul R
Click Generate as highlighted below,
Click Next and select the number sequence for the companies.
Rahul R