Stop or Prevent Inserting Grid Rows Via PeopleCode

Your rating: None Average: 3.2 (5 votes)

The PeoleCode below will prevent users from inserting more than 2 rows on a grid. The "+" button will disappear the moment a 2nd row is added by a user. I have place this code on a record field under rowinit event.
If GetRowset().ActiveRowCount = 1 Then
GetRowset().InsertEnabled = True;
GetRowset().InsertEnabled = False;

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!