Make your life easy -- would @formula do the trick? Stephan H. Wissel 25.Jan.05 09:14 PM Lotus Notes Applications Development All ReleasesAll Platforms
eventually you can lookup the value using @dblookup. If the number of documents per SSN is not too big (40k of data, =a couple of hundred docs) you can lookup that value in a (hidden) field before you kick off your script if it needs to be a script. Have a view with 3 columns C1: SSN, sorted C2: Creation Date (or whatever date is relevant), sorted descending, C3: @text(@documentuniqueID). Then you can get the Unid of the youngest doc with @subset(@dblookup("Notes":"NoCache";"";"lookupviewname";SSN;3);1). Using @getdocfield you can then pull other values.
If you need to script, then having that sorted view and v.getEntryByKey is pretty fast ---or if you need the whole document v.GetDocumentByKey.