Same formula, different results (I swear!)

On my web form, I have this formula in a field:

@If(@Trim(target) = “_center”; “DecreaseWidthCenter”; “DecreaseWidth”);

For new documents, only, it returns false all the time.

On the next line, I have the same formula in Computed-text:

@If(@Trim(target) = “_center”; “DecreaseWidthCenter”; “DecreaseWidth”);

It returns true when it should be true, and false when it should be false.

Are computed text’s calculated in a different order than fields? I thought all Notes forms were calculated top to bottom, left to right. What’s up, here?

Thanks.

-Jeff

Subject: How can this formula return True or False?

@If(@Trim(target) = “_center”; “DecreaseWidthCenter”; “DecreaseWidth”);

It should either return “DecreaseWidthCenter” or “DecreaseWidth”

Subject: RE: How can this formula return True or False?

I mean it returns the true value or the false value.

Subject: Where does the Field “target” get set and what is its Default Value?

Subject: RE: Where does the Field “target” get set and what is its Default Value?

It is set at the bottom of the form – after the code in question. It’s default value is “_center”.

Subject: Same formula, different results (I swear!)

I do not remember anything about computed-text areas and fields being evaluated in a different order on the web. Any chance that the TARGET field is between the two formulas mentioned?

Subject: Same formula, different results (I swear!)

IIRC the computed fields are computed before the WebQueryOpen agent, and the computed text after the WebQueryOpen agent has run.

Possible you’re only giving the field “target” a value in the WebQueryOpen agent?

cheers,

Bram

Subject: RE: Same formula, different results (I swear!)

There is no WebQueryOpen agent.

Target is an editable dialog list, default value “_center”. It is below the computed for display and computed text described in the first note.

Nonetheless, thanks for the info which I didn’t know until now.

IIRC?

Subject: Same formula, different results (I swear!)

Is your field Editable ??Since they are calcuated when the document is saved.

hope this helps !!

Ashish

Subject: RE: Same formula, different results (I swear!)

It is computed for display.

Edit: That is, the field described is cfd. Field target is editable.

Subject: Same formula, different results (I swear!)

“Are computed text’s calculated in a different order than fields?”

Yes.

“I thought all Notes forms were calculated top to bottom, left to right.”

Sorry, that’s not correct. Field values are calculated FIRST, then computed text after all fields are done.

You must have the “target” field defined lower on the form than the field that always seems to return false. Since for the field, the target value is always “”, it’s never “_center” and is therefore false everytime when the doc is NEW. Once it’s saved, there is a value.

The computed text is evaluating after all the field values are initialized, and therefore evaluates as expected.

Why don’t you move the target field to the top of the form?