Can't let the user enter a bad value in a browse

davsimm

New Member
How can I force a user to stay in the current cell until they enter a valid value? I have a browse and I require that the user enter a valid scrap reason if the scrap qty is GT 0. If they enter a incorrect code, how can I force them back in to to cell until they get it right?

Thanks!!

p.s. Right now, they can tab out of the cell, but the value doesn't get written if its not valid.
 
Great point Tom. Sometimes I feel sorry for users (Usually I just feel superior to them).

In the case that you have a legitimate reason for preventing a user from leaving a browse cell, try something like below. But always make sure you do not trap your user in this cell! The last thing you want is to get "end tasked".

Code:
ON LEAVE OF browse_cell
DO:
   IF /*SELF:SCREEN-VALUE is no good*/ THEN
      RETURN NO-APPLY.
END.
Or perhaps a nicer way would be to simply mark the cell value as invalid using a colour, eg SELF:BGCOLOR = 4.
 
As I've mentioned in another thread, if you APPLY "ENTRY" to the field before the RETURN statement you should find the cursor is stuck in the cell.
 
The real answer here is, don't do that. Modern standards are that users should be able to move around the screen even if there is bad data ... they just can't save the record. Color it red, put some kind of mark next to it, whatever, but don't keep them from leaving the cell. Among other things, what happens if they get a call that means they need to quit that screen and go to another one. Your way, they have to put in a valid value before they can leave! And, they may have to go do research to find the valid value because the data they are working from has an incorrect value.
 
Back
Top