Hi Everyone,I have strange problem. It work fine for everyone except with ONE user.
I have functionality when user clicks on one button of the current document, a new document has to open from other database based on unique key. If not found it has to create a new document in other database.
The problem is …for one user it will always opens a new document although there is a document with the key.
I tired with GetDocumentByKey & @Command( [FileOpenDatabase]. Both are not working.
note: user can goto that database and open any document. the problem is when i try to open through code it’s not working.
When I tried by hardcoding all the values, then Getdocumnetby returns nothing where as @Command( [FileOpenDatabase] gives wrong document.
I have this problem only with one user. please help me.
If you have problem with one user only, and for others the same code is working properly, THEN the problem must be associated with user’s Effective Access Level in that database ACL.
You said user can goto that database and open any document, can he Edit that document? I guess he is having Reader Access to database. And through code you were trying to open that document in Edit mode.
Also In document there are Readers and Authors fields which refines the database ACL. Also check that fields. I hope this helps you.
Subject: RE: Problem with GetDocumentByKey & @Command( [FileOpenDatabase]
It sounds like the user has re-sorted the view you’re using for lookups, so that the sort order is no longer by whatever key you normally use to find the document. That’s one reason it makes sense to use hidden views for your lookups; then you can open the document by its UNID.
Why use FileOpenDatabase to navigate to a document? Unless you needed to open the view for another reason, that’s a waste of time. Use EditDocument method in LotusScript to open just the document.
It’s opening a different document to only one user.
In lotus script:
Sub Click(Source As Button)
On Error Goto ProcessError
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
key="7B3DF519027D167F852574E80056F663"
server = "ABSSSO018"
path1="Dev\\apps\\regAttach.nsf";
Set db = session.GetDatabase(server, path1)
Set view = db.GetView( "ComUnID" )
Set doc = view.GetDocumentByKey(key, True )
If Not (doc Is Nothing) Then
Call ws.EditDocument(True, doc)
End If
Exit Sub
Subject: RE: Problem with GetDocumentByKey & @Command( [FileOpenDatabase]
I’ve looked at your earlier posts and I do not see the answer to this question. If you sit down at this user’s computer, using their ID, and manually open the view, and use the view quick search with the key value you are showing here, can you find the document in the view?
Just because there is not a Readers field in your application, does not mean that there could not be a Readers item in the document. You can create one in the Security tab of the document properties, for any document, regardless of the design of the application.
What is the formula of the sorted view column?
What happens when you run the same script?
If you look at the document’s properties, and on the second tab, find the item that contains the key value, what is the value of that item? What is the datatype of the item and its flags? Compare that to another document in the same view. Are they different in any way?