Make a Field Required using PeopleCode

Simple example of controlling whether a Field is required using PeopleCode instead of the Record definition properties.

Place this in the Record Field's SaveEdit PeopleCode.


If None(GetField().Value) Then
   GetField().SetCursorPos(%Page);
   GetField().Style = "PSERROR";
   Error MsgGet(15, 30, "Highlighted fields are required.");
Else
   GetField().Style = "PSEDITBOX";
End-If;

0 comments: