1. Create EDT
2. Use that EDT in the Table
where it is required
3. Select the Class
module which you going to implement this Number seq.
//Consider if we want for HRM then “NumberSeqModuleHRM” class is the target.
//Add below code in the loadModule()
protected void loadModule()
{
NumberSeqDatatype datatype
= NumberSeqDatatype::construct();
//Added by Alfasith
datatype.parmDatatypeId(extendedtypenum(customerID));
//your EDT
//your EDT
datatype.parmReferenceLabel(literalstr("RES-customerID"));
//Your label
//Your label
datatype.parmReferenceHelp(literalstr("RES-customerID"));
datatype.parmWizardIsContinuous(true);
datatype.parmWizardIsManual(NoYes::No);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmWizardLowest(1);
datatype.parmWizardHighest(99999999);
datatype.parmSortField(15);
//(This 15 is the next number that already in that default list)
//(This 15 is the next number that already in that default list)
datatype.addParameterType(NumberSeqParameterType::DataArea,
true, false);
this.create(datatype);
//code
end
}
4. Select the concern table. Create new methods as below
Here we take HRMParameters table
// table on which that number seq is going to generate.
// table on which that number seq is going to generate.
static client
server NumberSequenceReference
customer()
{
return NumberSeqReference::findReference(extendedtypenum(customerID));//Your EDT name
}
5. Create a new job with
the following code and run it:
static void NumberSeqLoadAll(Args _args)
{
NumberSeqApplicationModule::loadAll();
}
6. ( Control + W )
Select Organization administration-> Number Sequence-> Number
Sequence
Select the module //here we select Human Resources
Select the EDT you created //Surly that EDT you created will be
appear here.
Click GENERATE
7. Create a new job with
the following code and run it:
static void
NetvendNumberSeq(Args _args)
{
NumberSeq numberSeq;
StudentID num;
;
numberSeq = NumberSeq::newGetNum(VendParameters::student());
num =
numberSeq.num();
info(num);
}
8. Select the Form on
which that table is required.
Drop the table in to that form Data Source.
8(a). ClassDeclaration. Write the below code.
public class
FormRun extends ObjectRun
{
NumberSeqFormHandler
numberSeqFormHandler;
}
/*************************************************************/
8(b). Create new method
NumberSeqFormHandler numberSeqFormHandler()
{
if (!numberSeqFormHandler)
{
numberSeqFormHandler =
NumberSeqFormHandler::newForm(NetRMSParameters::customer().NumberSequenceId,
element,
Table2_ds,
fieldNum(Table2, customerID)
);
}
return numberSeqFormHandler;
}
/***********************************************************/
8(c). Override the datasource methods of that table with following
method in that form.
public void
delete()
{
;
element.numberSeqFormHandler().formMethodDataSourceDelete();
super();
}
/***********************************************************/
public void
write()
{
super();
element.numberSeqFormHandler().formMethodDataSourceWrite();
}
/***********************************************************/
public void
create(boolean _append = false)
{
;
super(_append);
element.numberSeqFormHandler().formMethodDataSourceCreate();
}
/***********************************************************/
Thanks for providing the solution..Found it useful Mohamed...
ReplyDelete