Simple Input Validation help needed (lists)

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: Simple Input Validation help needed (lists)

Problem solved, THANKS John!!!

The problem was I was using var = “1” instead of var = @True.

I have a lot to learn, and I am very grateful for the quick response from the community here.

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.

John

Subject: RE: Simple Input Validation help needed (lists)

var = 1 probably would have worked. @True returns 1 not “1”, with the quotes is a text value.

Subject: Simple Input Validation help needed (lists)

Joe,

Why are you using var = “1” and not var = @true

Also, you may want to use either @uppercase or @lowercase on both strings to make sure you get a match.

John

also, I do not think uopu should be using null, but rahter @trim( organizationName) = “”.

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?

Also…

The formula I am using to bring up my list is

@DbColumn(“Notes”:“NoCache”; “” : “” ; “Drawers”; 2)

It displays a list seperated by ; when I unhide it. My book indicates lists should be seperated by :

Could that be my issue?

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.

serv := @Subset(@DbName; 1);

db := @Subset(@DbName; -1);

vw := “ExistingDwawers”;

key := OrganizationName;

orgchk := @DbLookup(“” : “NoCache”; serv : db; vw; key; 1);

@If(@IsError(orgchk); “”; @Return(@Prompt([Ok]; “Warning …”; “Organization value already used, please enter another value.”)))

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.

that’s where i’d start anyway.

brandt

Subject: RE: Simple Input Validation help needed (lists)

Actually, I did not have the field ExistingDrawers set to allow multi-values. I did change it, however, that did not solve the problem.

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.

brandt