I am using the GetDocumentByKey method to retrieve a document using a view that has 2 sorted columns. I need to use both columns. Here is my code:
Set docAlevied = view1.getdocumentbykey(mkey,myear)
Since the view is sorted on 2 columns, I have added 2 parameters in the code.
myear is equal to “2006” but the code is returning the “2005” document. The “2006” document does not exist. So why doesn’t it return NOTHING instead of the 2005 document?
Set notesDocument = notesView.GetDocumentByKey( keyArray [, exactMatch% ] )
exactMatch%
Boolean. Optional. Specify True if you want to find an exact match. The first document that matches the key exactly is returned. If you specify False (the default) or omit this parameter, a partial match succeeds. A partial match returns the first document that matches the initial characters of the key.
Your not specifying your key properly (its expecting a key array, not multiple strings), take a look at designer help which will carify but if you want an exact match, you must use True.
i do not know if i am applying in the right place but let’s give it a try
I have similar situation like this one mentioned here. However I don’t get any document at all.
While running the code it tries to connect to outer lotus notes db and get a document according to a certain tabel number. However the function getdocumentbykey does not return any document at all. The funniest thing is that when I cut and paste the document in an outer database, the function starts working again - pulls out the right document.