How to validate saving of a document with the same value that already exist(like a primary key)?

How do i enable something like a primary key in a field such that no document can be saved where a similar value already exist?? thx!!

Subject: how to validate saving of a document with the same value that already exist(like a primary key)?

The Design Library Repository from IBM has a script library called UniqueKey for this purpose

you can download the design library database from sandbox:

http://www-10.lotus.com/ldd/sandbox.nsf/140e61e7f55c607685256ead0064d6c4?OpenForm&ParentUNID=816D64935EE8842485256C680051B592

Subject: RE: how to validate saving of a document with the same value that already exist(like a primary key)?

seems like its not usable on a field which dbcolumn another?? if able to, how?

Subject: RE: how to validate saving of a document with the same value that already exist(like a primary key)?

it works on any field except rich text. Read the comments on the option section of the UniqueKey script library, it tells you how to use it