/* EXAMPLE delete duplicate entries from the grid */
&Class_Meet = GetLevel0()(1).GetRowset(Scroll.INSTR_CLASS_VW);
&Class_Meet.Flush();
&Class_Cnt = &Class_Meet.Select(Record.INSTR_CLASS_VW, "WHERE EMPLID = :1 AND STRM = :2 AND INSTITUTION = :3", %EmployeeId, &Fac_Term, &Fac_Inst);
If &Class_Cnt > 1 Then
&Class_Meet.Sort(INSTR_CLASS_VW.CRSE_ID, "A");
For &i = &Class_Cnt To 1 Step - 1
If &i + 1 <= &Class_Cnt Then
If &Class_Meet(&i).INSTR_CLASS_VW.CRSE_ID.Value = &Crse_id Then
&Class_Meet.DeleteRow(&i);
&Class_Cnt = &Class_Cnt - 1;
End-If;
End-If;
&Crse_id = &Class_Meet(&i).INSTR_CLASS_VW.CRSE_ID.Value;
End-For;
End-If;
&Class_Meet = GetLevel0()(1).GetRowset(Scroll.INSTR_CLASS_VW);
&Class_Meet.Flush();
&Class_Cnt = &Class_Meet.Select(Record.INSTR_CLASS_VW, "WHERE EMPLID = :1 AND STRM = :2 AND INSTITUTION = :3", %EmployeeId, &Fac_Term, &Fac_Inst);
If &Class_Cnt > 1 Then
&Class_Meet.Sort(INSTR_CLASS_VW.CRSE_ID, "A");
For &i = &Class_Cnt To 1 Step - 1
If &i + 1 <= &Class_Cnt Then
If &Class_Meet(&i).INSTR_CLASS_VW.CRSE_ID.Value = &Crse_id Then
&Class_Meet.DeleteRow(&i);
&Class_Cnt = &Class_Cnt - 1;
End-If;
End-If;
&Crse_id = &Class_Meet(&i).INSTR_CLASS_VW.CRSE_ID.Value;
End-For;
End-If;
Comments
Post a Comment