@Prompt Return Values

Right.

So this may appear as a fairly straight forward process. But i want to Prompt for a Yes No option and based on whether the user clicks Yes or No i want an agent to run.

Heres my code.

tmpValue := @Prompt([YesNo]; “Suspension?”; “Will employee be suspended pending enquiry?”);

@Prompt([Ok]; “”; tmpValue);

@If(tmpValue = “1”; @Command([ToolsRunMacro]; “CallForm_Suspension”); “”);

I use the @Prompt([Ok]; “”; tmpValue); to try see the value of tmpValue… and it returns nothing.

What am i doing wrong here?

Subject: @Prompt Return Values

Straight from Designer help on @Prompt:

If the user selects Yes, returns 1 (True).

This is no String.

Subject: RE: @Prompt Return Values

Would you believe me if i told you i tried the 1 with and without “” and it still returned nothing. I walk in this morning and rerun the form and waallaa… it works. Im so over notes (came from a .net background)

thanks again.

Subject: RE: @Prompt Return Values

I know that feeling …

However, not that I’m going to worry you, but @Formulas are about the most reliable and rock solid thing you will come across in Notes. Must have been deadly .net-rays interfering. :slight_smile:

Subject: @Prompt Return Values

At the If condition while checking the value of the tmpValue variable, remove the quotes you had given for 1.

Th below code works fine for me:

tmpValue := @Prompt([YesNo]; “Suspension?”; “Will employee be suspended pending enquiry?”);

@If(tmpValue=1;@SetField(“Employee”;“Required”);@SetField(“Employee”;“Not Required”))