Reputation: 211
Question here, may i know using this way to open existing document is totally wrong, or i miss out some part?
Cuz currently not be able to open existing document.
Let say i already have the "document" inside with NRIC 851013-13-5125
Below is the code to get DocumentID
var vw:notesView = database.getView("Request sort by nric used for docID");
var doc:NotesDocument = vw.getDocumentByKey(document1.getValue("NRIC"), true)
if (doc!=null){
return doc.getItemValue("docID")
}
Upvotes: 0
Views: 43
Reputation: 20384
Desmond,
beside a HUGE security hole - displaying data based on an NRIC only (which is almost public data, since you use it everywhere to sign up for membership, discount cards etc.
You should change a few things:
document1.getValue("NRIC")
you use viewScope.NRIC
doc.universalid
, or better have that as a column in the view, so you could use @DbLookup(....)
/yourdb.nsf/byNRIC/[S12345678X]
having a view byNRIC
that is sorted by NRIC and has in the form property the XPage to openHaving said that: PLEASE(!!!) implement proper security. Singapore's legislation is VERY specific on data protection. You might want to read up on it here: https://www.pdpc.gov.sg/legislation-and-guidelines/overview
Upvotes: 0