Can't get "Return No-Reply" to work

davsimm

New Member
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.
 
You could add NO-ASSIGN to the browse definition then assign the value after leaving the cell or in ROW-LEAVE.
 
I did that. it works. However, I would like to refresh the value to what it was before they made the edit. Can I just replace the cursor in that cell and not let them out until the enter a valid value? Or could I just refresh the browse somehow so that the original value (before it was changed by the user) is displayed?

Thanks for your suggestion
 
If before the return statement you

APPLY "ENTRY" to shop-prod.reason-code IN BROWSE browse-1.

you should find that the cursor stays in the field you're updating. Hopefully anyway!
 
Back
Top