Can I have an If statement in the $$Return field?

Hi,

I need to have an @if in the $$return;

I ahve a field on the form computed Language and it is set to F, (and I can see it), now I have the $$return with this code,

it assumes that it is E regardless of the formula

@If( Language = “E”; messageE; messageF)

@If( Language = “F”; messageF; messageE)

any ideas…

p.

Subject: RE: Can I have an If statement in the $$Return field?

@If works in a $$Return field, just as it does in every other type of formula.

If it’s giving you incorrect results, it’s because you gave it incorrect data, or because the logic of your if is wrong in some way.

Unless you supply more details, it’s impossible to say what the problem is. For instance, your exact formula instead of formulas which are not the one you’re using, and tell us what the type is of your fields (computed, computed for display, …) and what all their formulas are, and in what order they appear on the form.

Subject: Just a thought

Are message1 and message2 in the right format for the $$return field, ie

“[http://www.google.co.uk]”

Andrew

Subject: Can I have an If statement in the $$Return field?

You can set the value of your $$return field to itself and set the value of the field in code (either with the formula language or javascript.

For example, before you submit the form, you could do your check and set the value of $$return to messageE or messageF.

Also, if those are actual field names on the form or variables set in your code, you could do something like (haven’t tested this):

//Field

msg:= @GetField(“message” + Language)

//Variable. This is the part I haven’t used or tested. Syntax is valid and there is more on this in the designer help.

msg:= @eval(“message” + Language)

msg