Catching error message in the component Interface?

       This function needs to be called when ever methods like Find, Save, Create methods return false.

        Error text and Error type can be printed in the log message for any other action in to the log messge.


Function CheckErrorCodes()
       &PSMessages = &Session.PSMessages;
       &ErrorCount = &PSMessages.Count;
       For &i = 1 To &ErrorCount
              &ErrorText = &PSMessages.Item(&i).Text;
              &ErrorType = &PSMessages.Item(&i).Type;
       End-For;

End-Function;