@Prompt returning strange result

This is from a hidden field in a form that is set to compute on creation. I believe that this formula is unchanged from what was working fine in R5. When the user chooses “No” when asked if the account is in the USA, the country list is presented and then when a country is selected the resulting document has a “1” as the value in the “Country” field rather than the country name. Any idea why?

@If(@IsDocBeingSaved & @IsNewDoc ; @Return(“”) ; @Success ) ;

FIELD Country :=

@If(

@Prompt([YesNo]; “US Based?”; “Is this profile address located in the United States?”) ;

@Return(“USA”) ;

@Prompt([OkCancelList]; “Country Selection”; “Please indicate the country where this company is located.”; “”;@Unique(@DbColumn(“”; DICT; “BunnLUCountry”; 2)))

);

Subject: @Prompt returning strange result

I would guess when you open the document your formula is always returning 1 - from the @Success, as this is the part of the @If statement which is true when it evaluates.

I have tried it, and it seems to work if you also put an @Return around the final @Prompt aswell.

How about something like this :

@If(

@Prompt( [YESNO]; “US Based?”; “Is this profile address located in the United States?”) = @Yes; “USA”;

@Prompt( [OKCANCELLIST]; “Country Selection”; “Please indicate the country where this company is located.”; “”;@Unique(@DbColumn(“”; DICT; “BunnLUCountry”; 2)))

C.

Subject: RE: @Prompt returning strange result

That worked. Thanks very much, Craig.