Creating a number sequence-
1. Create an
EDT-CustomerID- AOT >> Extended Data Types >> New
>> Properties >> Name >> CustomerID.
2. Create a table ,
Drag EDt(CustomerID). In the field node of dat table .
3. Go to classes –(num seq
(by default ))->NumSeqModuleNetRMs>>
4. Write the below code
protected void loadModule()
{
NumberSeqDatatype datatype = NumberSeqDatatype::construct();
//Added by santosh
datatype.parmDatatypeId(extendedtypenum(customerID));//(keep ur (EDT)/
datatype.parmReferenceLabel(literalstr(“RES-customerID”));
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);//(change the no to next)//
datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
this.create(datatype);
//code end
}
After this go to tables net rms parameters (as per the module)
and write the below code.
static client server NumberSequenceReference customer()
{
return NumberSeqReference::findReference(extendedtypenum(customerID));
}
>>After dis go to jobs and run the below codes
Job1.
static void NumberSeqModuleVendor(Args _args)
{
NumberSeqModuleVendor obj = new NumberSeqModuleVendor();
obj.load();
}
5. go to organization administration.
6.number sequence>>Generate>>Wizard will
appear click on next until finish.
7. after Wizard change area and reference based on
module and reference on EDt(CustomerID),company.
As shown below.
7. Change ceu then click on the record.
8. constant ,continuous to (uncheck)
Job2.
static void NetvendNumberSeq(Args _args)
{
NumberSeq numberSeq;
StudentID num;
;
numberSeq =
NumberSeq::newGetNum(VendParameters::student());
num = numberSeq.num();
info(num);
}
9.create a form drag table in data source .
10.go to forms>>methods ..new method>>in forms find
no Seq (ctrl+s).
Write the below code in method.
NumberSeqFormHandler numberSeqFormHandler()
{
if (!numberSeqFormHandler)
{
numberSeqFormHandler =
NumberSeqFormHandler::newForm(NetRMSParameters::customer().NumberSequenceId,
element,
Table2_ds,
fieldNum(Table2,
customerID)
);
}
return numberSeqFormHandler;
}
11. go to classdecleration. Write the below code .
public class FormRun extends ObjectRun
{
NumberSeqFormHandler numberSeqFormHandler;
}
12.go to datasource table >>methods write create
write delete methods
13.
As the codes below-
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();
}
To Create a number sequence in table-
public void initValue()
{
NumberSeq num =
NumberSeq::newGetNum(LedgerParameters::NumRefProd());
super();
num.used();
this.Prod = num.num();
}
No comments:
Post a Comment