Prevent duplicate field

I’m using code similar to this to make sure a field is not duplicated. However, because of the “@Contains" function, my form will not validate if the value in the field contains even a portion of what the DBColumn search returns.

For example: If I have a saved document with “12345678” in the SAC field, it will not let me create a document with “123456” in the SAC field.

Would you know of a way around this?

lookup:=@DbColumn(“Notes”:“NoCache”;@DbName;“ViewName”;1);

look:= @If(@IsError(lookup);“”;lookup);

@if(@IsNewDoc & @Contains(look;Your Field Name);@Failure(" SAC Field value already exists. Please Enter New SAC Number.");@Success)

Subject: prevent duplicate field

@isMember

regards,

raphael

Subject: RE: prevent duplicate field

Or, use @DbLookup instead of @DbColumn; this is more efficient since it’s not necessary for the server to send an entire column of data to the client, and it will keep working even when the data in the column exceeds 64KB.