Error message hijacking my message popup.

I want to display a message to the user, letting them know why a page cannot be edited. But when I put in something like:
OnAfterGetCurrRecord()
  IF (CurrPage.EDITABLE = FALSE) THEN
    MESSAGE('some message');
Then i instead get an error message saying: "Server page is not open. Page <page name> must close." (<page name> being the previous page that runs the current page)
Note that this error only appears when I try to display a message, and when dismissed, the page displays as normal, except the message i wanted to show never appears.

Currently I have "solved" it like this:
OnAfterGetCurrRecord()
  IF (CurrPage.EDITABLE = FALSE) THEN BEGIN
    MESSAGE('');
    MESSAGE('some message');
  END;
With the empty message sort of "catching" the error, meaning both the error and my message get displayed.

Has anyone experienced something like this before?

Answers

  • krikikriki Member, Moderator Posts: 9,112
    You shouldn't put messages in the OnAfterGetCurrRecord....
    If a user wants to know why the current record is not editable, use an action that gives the message.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.