You can write the following code on page or table:
Page level:
OnInsertRecord(BelowxRec : Boolean) : Boolean
IF (Name = '') OR (Password = '') THEN
ERROR('required');
OnModifyRecord() : Boolean
IF (Name = '') OR (Password = '') THEN
ERROR('required');
Table level:
OnInsert()
IF (Name = '') OR (Password = '') THEN
ERROR('required');
OnModify()
IF (Name = '') OR (Password = '') THEN
ERROR('required');