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:
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:
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…)