This code should be written on the level 0 record (parent record) Save edit event or Save prechange.
For &i = &rs.ActiveRowCount To 1 Step - 1/*get the grid active rowcount */
&flag = &rs.GetRow(&i).GetRecord(Record.XYZ_WRK).GetField(Field.DELETE).Value;
If &flag = "Y" Then
&Ret = MessageBox(4, "", 23002, 1, "selected will be deleted. Are you sure? Yes / No", 0);
/* if user clicks on yes button then only it will delete the row */
If &Ret = 6 Then
&rs.DeleteRow(&i);
Else
End-If;
End-If;
End-For;
Note: We cannot write the code to deletee or hide rows in the same level. You should write the code in the parent record of the child record.
For &i = &rs.ActiveRowCount To 1 Step - 1/*get the grid active rowcount */
&flag = &rs.GetRow(&i).GetRecord(Record.XYZ_WRK).GetField(Field.DELETE).Value;
If &flag = "Y" Then
&Ret = MessageBox(4, "", 23002, 1, "selected will be deleted. Are you sure? Yes / No", 0);
/* if user clicks on yes button then only it will delete the row */
If &Ret = 6 Then
&rs.DeleteRow(&i);
Else
End-If;
End-If;
End-For;
Note: We cannot write the code to deletee or hide rows in the same level. You should write the code in the parent record of the child record.
No comments:
Post a Comment