Form.RUNMODAL = ACTION

I have a form i use as a dialogbox… but the return value i try to fetch want let me put it in a variable… Example: ReturValue := Form.RUNMODAL; This give me the error “code := action” and i need to check for more then one actiontype. codeunit should work differente out of the choice from the user. Example he can use the esc or ‘x’ in the form, he can push ‘Ok’ or the ‘Cancel’. For me this sounds like a code similar to this: IF (Form.RUNMODAL = ACTION::Cancel = TRUE) OR (ACTION::Close) THEN or IF Form.RUNMODAL = ACTION::Cancel||Close = TRUE THEN Or anything like this… anybody know? Caz several runmodal’s will only pop up the form again [:o)] Frode

CASE FORM.RUNMODAL(67000) OF ACTION::OK: MESSAGE('OK'); ACTION::Cancel: MESSAGE('Cancel'); ACTION::Close: MESSAGE('Close'); END; ERROR('Tjohoo'); maybe?

There is also a variable type Action. Maybe it’ll help -

quote:


Originally posted by Navigera LG

CASE FORM.RUNMODAL(67000) OF ACTION::OK: MESSAGE('OK'); ACTION::Cancel: MESSAGE('Cancel'); ACTION::Close: MESSAGE('Close'); END; ERROR('Tjohoo'); maybe?


Thnx for the suggestions… i did not know about that Action type and that gave me the right value in the variable. And the switch was nice thinking… with a mix of those two i made it work. Thnx again … [:p]

You can not assign an integer to a CODE variable, set the ReturnValue to type Integer, Option or Action.