RE: Duplicate Check Kevin Pettitt 14.May.09 02:18 PM a Web browser Domino Designer All ReleasesAll Platforms
dim session as new notessession
dim db as notesdatabase
dim invoicelookup as notesview
dim dupeinvoicedoc as Notesdocument
set db = session.currentdatabase
set invoicelookup = db.getview("name of invoice lookup view")
call invoicelookup.refresh 'be sure it is up to date
set dupeinvoicedoc = invoicelookup.getdocumentbykey(<invoicenumberjustentered>)
If not dupeinvoicedoc is nothing then
Messagebox "duplicate invoice number, try again"
you invoicelookup view would need at a minimum a single column sorted on invoicenumber, containing all existing invoices.