1) we need to create EDT as string KBNumSeqCustGroupNum.
2) we need to add code for the particular module. so we have to choose which module we are going to add number sequence.in this case ,am going to add in customer module.Class--NumberSeqModuleCustomer--LoadModule Method
3) Go to OA-Common-Number Sequence . Click Generate Button
Click the details button below and set or change the value as you like in the number sequence, highest and lowest and format.
Click finish button
Go to the Custgroup table and added KBNumSeqCustGroupNum edt to the field and set the allow edit as NO. add the KBNumSeqCustGroupNum edt to overviewgroup in the table.
open the custgroup form. add the following codes .
2) we need to add code for the particular module. so we have to choose which module we are going to add number sequence.in this case ,am going to add in customer module.Class--NumberSeqModuleCustomer--LoadModule Method
Click finish button
Go to the Custgroup table and added KBNumSeqCustGroupNum edt to the field and set the allow edit as NO. add the KBNumSeqCustGroupNum edt to overviewgroup in the table.
open the custgroup form. add the following codes .
- Write the following code on the Class declaration nodeNumberSeqFormHandler numberSeqFormHandler;
- Create a new method on the form and write the following codeNumberSeqFormHandler numberSeqFormHandler(){
if (!numberSeqFormHandler){//create a reference of number sequence form handler class specifying the EDT, Data source name and the field of the tablenumberSeqFormHandler =NumberSeqFormHandler::newForm(NumberSeqReference::findReference(extendedtypenum(KBNumSeqCustGroupNum)).NumberSequenceId, element,CustGroup_DS,fieldnum(CustGroup,KBNumSeqCustGroupNum));}return numberSeqFormHandler;
} - Override the close method of the form and write the following codepublic void close(){if (numberSeqFormHandler){numberSeqFormHandler.formMethodClose();}super();}
- Override the create method on the CustGroup data source and add the following codepublic void create(boolean _append = false){
element.numberSeqFormHandler().formMethodDataSourceCreatePre();super(_append);element.numberSeqFormHandler().formMethodDataSourceCreate(true);} - Override the write method on the CustGroup data source and add the following codepublic void write(){
super();element.numberSeqFormHandler().formMethodDataSourceWrite();} - Override the validateWrite method on the CustGroup data source and add the following codepublic boolean validateWrite(){
boolean ret;ret = super();ret = element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret) && ret;return ret;} - Override the delete method on the CustGroup data source and add the following codepublic
void delete(){element.numberSeqFormHandler().formMethodDataSourceDelete();super();} - Override the linkActive method on the CustGroup data source and add the following codepublic
void linkActive(){element.numberSeqFormHandler().formMethodDataSourceLinkActive();super();}
once we complete the above procedure, just open the custGroup form and click new button automatically number sequence field is added as well as number filled.
No comments:
Post a Comment