Saturday, October 19, 2013

Dynamic Grid -



 &SQLString = "SELECT A.COMMON_ID,  C.NAME,A.CHECKLIST_CD, D.XLATLONGNAME FROM PS_PERSON_CHECKLST A, PS_NAMES C, PSXLATITEM D WHERE A.CHECKLIST_STATUS = 'I'  AND C.EFFDT = (SELECT MAX(C_ED.EFFDT) FROM PS_NAMES C_ED WHERE C.EMPLID = C_ED.EMPLID AND C.NAME_TYPE = C_ED.NAME_TYPE AND NAME_TYPE='PRI' AND C_ED.EFFDT <= SYSDATE) AND A.COMMON_ID = C.EMPLID AND  D.fieldname = 'CHECKLIST_STATUS' AND D.FIELDVALUE = A.CHECKLIST_STATUS AND A.COMMON_ID IN (SELECT HM.EMPLID FROM PS_MHN_PENDDOC_VW HM) ";
       
&sql1 = CreateSQL(&SQLString);
             
 &rsStep = GetLevel0()(1).GetRowset(Scroll.MHN_PENDOC_TBL);
 &rsStep.Flush();
 &gridrow_i = 0;
While &sql1.Fetch(&HM_COMMON_ID, &HM_NAME, &HM_DESCR, &HM_XLATLONGNAME)
                  
&gridrow_i = &gridrow_i + 1;
&rsStep.InsertRow(&gridrow_i);
&rsStep(&gridrow_i).MHN_PENDOC_TBL.OPRID.Value = %OperatorId;
SQLExec("SELECT A.NAME FROM PS_PERSON_NAME A,psoprdefn B WHERE A.EMPLID = B.EMPLID AND NAME_TYPE = 'PRI' AND B.OPRID = :1", %OperatorId, &HM_OPR_NAME);
&rsStep(&gridrow_i).MHN_PENDOC_TBL.GetField(Field.NAME).Value = &HM_OPR_NAME;
 &rsStep(&gridrow_i).MHN_PENDOC_TBL.EMPLID.Value = &HM_COMMON_ID;
 &rsStep(&gridrow_i).MHN_PENDOC_TBL.FULL_NAME.Value = &HM_NAME;
 &rsStep(&gridrow_i).MHN_PENDOC_TBL.DESCR.Value = &HM_DESCR;
 &rsStep(&gridrow_i).MHN_PENDOC_TBL.XLATLONGNAME.Value = &HM_XLATLONGNAME;
SQLExec("SELECT DESCR,CLASS_SECTION,EXPIRATION_DATE,DESCR1,NATIONAL_ID FROM PS_MHN_PENDDOC_VW WHERE EMPLID = :1 AND ROWNUM = 1", &HM_COMMON_ID, &HM_PT_DESCR, &HM_PT_CLASS_SECTION, &HM_PT_EXPIRATION_DATE, &HM_PT_DESCR1, &HM_PT_NATIONAL_ID);;
&rsStep(&gridrow_i).MHN_PENDOC_TBL.CLASS_SECTION.Value = &HM_PT_CLASS_SECTION;
&rsStep(&gridrow_i).MHN_PENDOC_TBL.DESCR1.Value = &HM_PT_DESCR;
&rsStep(&gridrow_i).MHN_PENDOC_TBL.DESCR2.Value = &HM_PT_DESCR1;
&rsStep(&gridrow_i).MHN_PENDOC_TBL.EXPIRATION_DATE.Value = &HM_PT_EXPIRATION_DATE;
&rsStep(&gridrow_i).MHN_PENDOC_TBL.NATIONAL_ID.Value = &HM_PT_NATIONAL_ID;
             
End-While;
               &rsStep.DeleteRow(&gridrow_i + 1);

No comments:

Post a Comment