The syntax for "GetDocumentByKey" is -->
Set notesDocument = notesView .GetDocumentByKey( keyArray [, exactMatch% ] )
Return value is -->
A NotesDocument. The first document in the view whose column values match each of the values in the keyArray. If there is no matching document, the return value is Nothing.
However, if document has a new line present in column values, then it might appear as the return value.
Example -->
Let's say the value of "keyArray" is in the below format for Doc1:
UserA-UserB
Doc 2 has a document with matching content. But the value of the field to be searched is as below -->
UserA-UserB
TestTestTest
That means matching key "UserA-UserB" followed by a new line and then other content (could be anything) is there in Doc2.
The key in Doc1 does not have a new line in it, but still, it can give output as Doc2 while searching when GetxxxByKey is used.
The situation remains the same with other available LotusScript methods like "GetAllDocumentsbykey", "GetEntrybykey" and "GetAllEntriesByKey".
The behavior remains the same even if one uses the Formula language "@Dblookup".