Check For Data Duplicates On A Grid
Check For Data Duplicates On A Grid
http://www.compshack.com/peoplesoft/peoplecode/check-for-data-duplicates-a-grid http://www.compshack.com/peoplesoft/delete-grid-blank-rows-entered-users-when-saving
Vvv Imp: http://peoplesoft.wikidot.com/effective-dates-sequence-status --- how to enter duplicate rows for a key field in a grid in peoplesoft
/* Check for data duplicates on a grid. */ Local Row &row1, &row2; Local number &r, &r1; &rs = GetLevel0().GetRow(1).GetRowset(Scroll.grid_table); For &r = 1 To &rs.ActiveRowCount /*Get grid row*/ &row1 = &rs.GetRow(&r); /*once we have a row, we are going to loop through the grid rows and make sure a specific field value is unique*/ For &r1 = 1 To &rs.ActiveRowCount &row2 = &rs.GetRow(&r1); /* if this is a different row, and the field_name value matches then throw an error*/ If &r1 <> &r And &row1.grid_table.field_name.Value = &row2.grid_table.field_name.Value Then MessageBox(0, "", 0, 0, "Error. Duplicate values are not allowed."); End-If; End-For; End-For;