I’m a new Notes developer, and I’m having trouble with what I thought would be a simple Input Validation.
I want a text editable field “OrganizationName”, to require a unique response, so for example, no 2 documents could have the same answer in “OrganizationName”.
I have a hidden field at the top of the form that pulls a list of all existing “OrganizationName”. That field is called “ExistingDrawers”
Here is my current validation formula.
var := @IsMember(OrganizationName;ExistingDrawers);
@If(OrganizationName= NULL | var = “1”; @Failure(“You must enter a unique name for this drawer”); @Success)
When I re-use the same OrganizationName, I don’t get the failure result. What am I missing?
Thanks in advance for any help.
Joe Brender
Edit:
The problem was resolved, the issue was using var=“1” instead of var=@True . This community is great.
Subject: RE: Simple Input Validation help needed (lists)
Joe,
FYI. @false and @true should be used, while using 0 and 1 will work, it is more for Windows. On a Unix box, 0 is still false, however -1 is true. You’ll find in LotusScript, that 0 is false and -1 is true.
By using the constants, you application will be be truly be operating system independant.
Futher FYI, 0 does not have any bits on, which why it is false, however -1 has all bits on which means it is true, under windows if any bit is on, then the value is true. Something a wise man taught me may moons ago.
Subject: RE: Simple Input Validation help needed (lists)
I’m using var = “1” because in my training book it says that @IsMember returns 0 when the value is false. That made me think that @IsMember would return either a 1 or a 0. Does it actually return an @true or an @false?
Subject: RE: Simple Input Validation help needed (lists)
Joe,
John is on the right track…@IsMember returns NUMERIC values. You are checking for a string value.
I’m sorry I missed that before.
brandt
ps. on the @DBColumn everything looks right…although if the real-time data isn’t going to change that much, I would look into changing that NoCache for performance reasons…
Subject: Simple Input Validation help needed (lists)
Not sure how you are populating your ExistingDrawers field but presumably you are doing a view lookup. Perhaps a better solution would be to move your lookup to the validation check and see if the value of Organization exists in the view, if not then the validation succeeds.
Subject: Simple Input Validation help needed (lists)
Joe,
Can’t say for certain, but I have had this burn me in the past…is your hidden field ExistingDrawers set up to allow multi-values? If not, it will concatenate all of your text list values into one string, and you will not find your match.
Subject: RE: Simple Input Validation help needed (lists)
Are you still using the docs created before you changed it to test? Changing the field property on the form will now allow for multi-values, but any data created before that change was made will remain concatenated.
In your original post, you never show us how you generate the list in the ExistingDrawers field. If you could post that, maybe there is something in that formula or script that is causing the issue.