I am allowing users to change the value of a cell in a browse.
On the LEAVE trigger, the program checks to see if the value is valid.
I know this works because I can see the data value and the screen
value and I throw up an error message when the screen value is not acceptable.
The PROBLEM is that I use RETURN NO-APPLY and the browser still
updates the record in the database. I see the error message, but it doesn't send the focus
back to the cell. It just goes to next cell as if there wasn't an issue.
Should I use some other statement, or am I just using this one incorrectly? below is the code:
FIND shop-reason WHERE shop-reason.reason-code = shop-prod.reason-code:SCREEN-VALUE IN BROWSE browse-1.
IF NOT AVAILABLE shop-reason THEN DO:
MESSAGE "Not a valid Reason Code.".
RETURN NO-APPLY.
END.
On the LEAVE trigger, the program checks to see if the value is valid.
I know this works because I can see the data value and the screen
value and I throw up an error message when the screen value is not acceptable.
The PROBLEM is that I use RETURN NO-APPLY and the browser still
updates the record in the database. I see the error message, but it doesn't send the focus
back to the cell. It just goes to next cell as if there wasn't an issue.
Should I use some other statement, or am I just using this one incorrectly? below is the code:
FIND shop-reason WHERE shop-reason.reason-code = shop-prod.reason-code:SCREEN-VALUE IN BROWSE browse-1.
IF NOT AVAILABLE shop-reason THEN DO:
MESSAGE "Not a valid Reason Code.".
RETURN NO-APPLY.
END.