To Creating NumberSequence Table Level
1. Create an edt : CarId .
AOT >> Extended Data Types >> New >> Properties >> Name >> Car Id.
2. Write a code on lode module() on NumberSeqModuleProject
{
datatype.parmDatatypeId(extendedTypeNum(Car Id));
datatype.parmReferenceHelp(literalStr("@SYS334483"));
datatype.parmWizardIsManual(NoYes::No);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmWizardHighest(999999);
datatype.parmSortField(20);
datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
this.create(datatype);
}
3.Write a method on Projparameters Table
client server static NumberSequenceReference numRefcarId()
{
return NumberSeqReference::findReference(extendedTypeNum(car Id));
}
4.Write a job and run that
static void Carid(Args _args)
{
NumberSeqModuleProject NumberSeqModuleProject = new NumberSeqModuleProject();
;
NumberSeqModuleProject.load();
}
5. Then run the wizard
Organization Administration >> CommonForms >> Numbersequences>>Numbersequences>> Generate >> run the wizard.
6.Now we have to check the number sequence is correctly working for that write a job:
static void number(Args _args)
{
NumberSeq numberSeq;
CarId num;
;
numberSeq = NumberSeq::newGetNum(ProjParameters::numRefcarId());
num = numberSeq.num();
info(num);
}
Run the above job.We will find the generated Numbersequence.
Now Create a new method in the required table
public void initValue()
{
NumberSeq NumSeq;
;
super();
NumSeq = NumberSeq::newGetNum(CustTable::numRefcarid(),true); //Your Table:: your method
this.Car Id= NumSeq.num(); // your field name (EDT)
}
create a new method to get NumRefID
public client server static NumberSequenceReference numRefcarid()
{
;
return NumberSeqReference::findReference(extendedTypeNum(carid)));
}
{
NumberSeq NumSeq;
;
super();
NumSeq = NumberSeq::newGetNum(CustTable::numRefcarid(),true); //Your Table:: your method
this.Car Id= NumSeq.num(); // your field name (EDT)
}
create a new method to get NumRefID
public client server static NumberSequenceReference numRefcarid()
{
;
return NumberSeqReference::findReference(extendedTypeNum(carid)));
}
No comments:
Post a Comment