Friday 16 October 2015

Highlight empty fields in RED for error messages


Question Rating Field  is present in a grid  and on page save button , I am verifying that it should not be empty . I have a custom save button and I have written this code on save button field change event.


Local Rowset &level1;

&level1 = GetLevel0().GetRow(1).GetRowset(Scroll.L_INST_EVAL_TBL);
For &i = 1 To &level1.ActiveRowCount
  
  
   If None(&level1.GetRow(&i).L_INST_EVAL_TBL.L_QUESTION_RATING.Value) Then
      SetCursorPos(%Page, L_INST_EVAL_TBL.L_QUESTION_RATING, CurrentRowNumber());
     
     
     
      &level1.GetRow(&i).L_INST_EVAL_TBL.L_QUESTION_RATING.Style = "PSERROR";
      Error MsgGet(31000, 23, "Please Select  A Rating value");
     
   Else
      &level1.GetRow(&i).L_INST_EVAL_TBL.L_QUESTION_RATING.Style = "PSEDITBOX";
   End-If;
  
  
End-For;