This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Sep 25, 2014, 9:56 AM
28 Posts

Editable form fields, and validation formula (@-code)

  • Category: Notes Client
  • Platform: Windows
  • Release: 9.0.1
  • Role: End user,Developer
  • Tags: @Formula
  • Replies: 3
This, I haven't (yet) verified on other Platforms but Windows 7 (64 bit) Notes 9.0.1 FP2, but I guess it would be the same all over.
I have a form with one field: AuditNote
Its defined as an Editable Text-field.

I want to Validate, based upon Roles, the AuditNote field to have content. This is the Validation code:
REM {NB ! Makes us of the ThisValue and ThisName @-functions};
REM {Use Debugger as described in Notes Net article:};
REM { Create your own formula debugger, by Craig Lordan, Dec. 1999};
REM {Tip: Remember always to convert to text in prompts especially after Lookups};

Debug := @If(@Environment("AllDebug") = "Yes"; @True; @False);
AdminUser := 0;
AdminUser := @If(@IsMember("[DBAdmin]"; @UserRoles);@True;@IsMember("[xx-Admin]"; @UserRoles);@True;@False);

@If(Debug; @Prompt([Ok]; "Debug Pre 1"; "Roles assigned to current user (Admin "+@Text(AdminUser)+") roles: " + @NewLine + @Implode(@UserRoles; ";")); @Success);


@If(AdminUser = 1;@Success;
@ThisValue="";@Failure("Saving a document, requires an explanation in the "+@ThisName+" field");
@Success)

The problems I have found is the following two, of which the first is the most annoying which I believe is a bug:
  1. The Validation is driven when I Open a document created with this Form, in Edit mode - before the user (poor me) has tried to Refresh, Edit something or anything !!!
    I added : @IsDocBeingSaved as criteria too, without luck it looks as the document gets saved (but really, it doesn't based on Revision history) ?!!
    So I can't make Validation @code that checks (that's what validation is for) missing information !
    (and no, there is no Automatic refresh in the form properties, nor calculations in preceeding fields that trigger refresh). I get this prompt (from the @Failure statement), whenever I do Document Edit:
  2. Second, the Prompt (useful for Debugging) seems in Notes 9 to allow far less data to be displayed !
    In above example, I have seen 482 characters being displayed in the Prompt !
    The Designer Help 8.5 (thank god its still on my Client, the Notes 9 designer is useless as I see it) says this for the Prompt function:
    "...
    The maximum number of characters you can include in the text that displays is 255..."
    I'm sure my Notes 8.5* was able to display almost twice or more (can't reproduce, I have gone to Notes 9...)
Sep 29, 2014, 10:31 AM
28 Posts
A temporary workaround, until its fixed by IBM could be..
As mentioned, I have tried a number of attempts and variations that seems odd, compared to the behaviour of Notes 3 - versions up to and incl. Notes 8.5.+:  See Reference below.
The evidence I have, shows that the Validation code is driven not only when a document is Saved, Recalculated or Refreshed but also when document is opened in Edit mode !

I found out, I can temporarily, make this workaround (with blue markup) as long I'm am not going to maintain forms and code for all our legacy databases:

@If(AdminUser = 1;@Success;@IsDocBeingRecalculated;@Success;
        @ThisValue="";@Failure("Saving a document, requires an explanation in the "+@ThisName+" field");
        @Success)

The backside of this workaround, is that the normal behaviour of getting fields checked, is deferred to the time when user tries to Save.

Reference:

From Notes 8.5.2 Designer Help

Notes Link --> here to the 'Editable Field Formulas' entry, of which I excerpt this:

  • The input validation formula checks the contents of a field against predefined criteria, making sure the entry meets certain requirements. For example, use an input validation formula to ensure that users fill in a required field. Input validation formulas are evaluated each time a document is saved, recalculated, or refreshed.
Dec 18, 2014, 4:48 PM
28 Posts
Filed as a PMR with IBM today,...
using the SPRID (Internal field, of the Parent document) PROG9PADS9 as the Customer Ticket Reference.
Jan 15, 2015, 7:38 AM
28 Posts
Had to withdraw PMR ! Could not reproduce it consistently any longer :-(
It sounds as bad news, but its not.

I might have had some Debug sessions over e period of hot-restarts of my Win7 Designer client, so I guess I came across the kind of 'memory leak' problem that shows by completely never seen and weird errors.

After I filed the PMR, I was asked to deliver a sample to re-produce the symptoms, which is fair, but I could no longer !

The good news is, that the intended code for @Evaluation formulas can be made as one hoped for.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal