Failure in validation formula causes hide when formula not to recalculate

I have an editable field and a button on a form. As an option, the button may be pressed to populate the field. The button is hidden if the editable field is not blank.

If I fill in the field and press tab, the button gets hidden as expected. If I then go back, blank the field and press tab, a validation error is generated as expected but the hide when for the button does not show the button as expected.

If I remove the validation formula the button hides and appears as expected.

Has anyone seen this behavior? I suppose there is nothing I can do aside from making the button appear all of the time or create a Lotus Script validation in QuerySave?

P.S. It does not seem to matter where I place the button, above or below the editable field, i still does not show as expected if there is a validation error.

Subject: Failure in validation formula causes hide when formula not to recalculate

Can you post your validation formula here?

Subject: RE: Failure in validation formula causes hide when formula not to recalculate

Really simple actually

@If(MyField=“”;@Failure(“Field cannot be blank”);@Success)

Hide when for button is:

MyField != “”

Subject: RE: Failure in validation formula causes hide when formula not to recalculate

Try one of the following:

Try changing the input validation formula to:

@If(

MyField=“”;

  @Do(

     @Command([RefreshHideFormulas]);

     @Failure("Field cannot be blank");

  )

@Success

)

If that doesn’t work you might be able to put the ‘@Command([RefreshHideFormulas])’ function into the input translation formula.

Alex

Subject: RE: Failure in validation formula causes hide when formula not to recalculate

Already tried that in input validation! :slight_smile:

You get a message saying @commands cannot be used in this context.

I suspect a similar outcome by putting it in the tranalation formula.

Subject: RE: Failure in validation formula causes hide when formula not to recalculate

Perhaps you could put something in the QuerySave event on the form which calls ‘NotesUIDocument.RefreshHideFormulas’ and / or put your validation code in there and if it fails set ‘Continue’ to False to prevent the form saving.

Example:

If Trim(Source.FieldGetText(“MyField”)) = “” Then

Messagebox "MyField cannot be blank.  Please check the value.", 0+16, "MyField"

Call Source.RefreshHideFormulas

Continue = False

End If