Stopping users cancelling out of an option question

Discuss your general Proclaim related queries here.
Post Reply
kettleashlee
Posts: 11
Joined: Fri Jun 01, 2018 12:16 pm
Has thanked: 4 times

Stopping users cancelling out of an option question

Post by kettleashlee » Mon Mar 04, 2019 2:07 pm

Hello,

We need to create a question that brings up an option field for the user to select and the return value will populate a field on a screen, no problem however we need to stop people from just cancelling out of the question as it has to be completed.

Anyone know of the best way to do this? We've thought of using the IF and WHILE DO statements but these generally link to the field instead of the actual pop up?

Thanks

David P
Posts: 12
Joined: Thu Jan 11, 2018 10:33 am
Been thanked: 1 time

Re: Stopping users cancelling out of an option question

Post by David P » Mon Mar 04, 2019 2:37 pm

Try something like this:

Code: Select all

QUESTION( "Please select an option" , "OPTION" , {Your_Option.Description} ) 
WHILE return-state = "CANCEL" DO 
    MESSAGE( "You must select an option" ) 
    QUESTION( "Please select an option" , "OPTION" , {Your_Option.Description} ) 
END 
PUT( return-value , {Your_Option.Description} ) 
UPDATE( {case.key} , "" ) 

kettleashlee
Posts: 11
Joined: Fri Jun 01, 2018 12:16 pm
Has thanked: 4 times

Re: Stopping users cancelling out of an option question

Post by kettleashlee » Mon Mar 04, 2019 2:52 pm

Thank you! I can see where i was going wrong. I was putting return-value = cancel instead of state and because cancel wasnt an option it was getting confused. thank you! thats worked a treat!

David P
Posts: 12
Joined: Thu Jan 11, 2018 10:33 am
Been thanked: 1 time

Re: Stopping users cancelling out of an option question

Post by David P » Mon Mar 04, 2019 2:57 pm

You're welcome! I go round in circles with that kind of thing on a regular basis :lol:

Proclaim_Dev
Posts: 1
Joined: Fri Mar 01, 2019 1:53 pm

Re: Stopping users cancelling out of an option question

Post by Proclaim_Dev » Wed Mar 06, 2019 9:14 am

kettleashlee wrote:
Mon Mar 04, 2019 2:52 pm
Thank you! I can see where i was going wrong. I was putting return-value = cancel instead of state and because cancel wasnt an option it was getting confused. thank you! thats worked a treat!
You can use.

return-state = "cancel" or return-value = "?"

Both give the same outcome as far as I am aware, I tend to use 'return-value' because everything else does in that context. I'd rather keep the same convention over the system to keep it standard.

steve
Posts: 380
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 75 times

Re: Stopping users cancelling out of an option question

Post by steve » Wed Mar 06, 2019 11:02 am

There's a small caveat/inconsistency in checking for an answer to a LOGical question and the user hits the escape key to exit out of the question. In this instance, return-state= "OK" and return-value = ""
More detail:
viewtopic.php?t=471#p1671
I appreciate the poster is just referring to an Option field, in which case the post from Mon Mar 04, 2019 2:37 pm (checking for return-state = "CANCEL" )would be sufficient.

Just a note of caution in the code example from Mon Mar 04, 2019 2:37 pm where

Code: Select all

put(return-value, {option.Description})
The return-value from an Option Question is always the first column in the Option Table itself, which is usually set up to be Code (but might legitimately be Description), so even if you ask the question to display "Description" column (or any other column in your Option field), be sure to have your PUT into whatever is the first column.

Post Reply