Set docTask = dbTask.GetDocumentByUNID(note.TaskUniqueID(0))
fails with an error message of “Invalid universal Id”
According to the debugger
dbTask is pointing to the correct database
the value of note.TaskUniqueID(0) is at the call above = 3EA3D86C3EA32714C1256CD00046001E, (It was previously established in another script by note.TaskUniqueID = docTask.UniversalID )
The properties of the document in dbTask that docTask should end up pointing to after the script line above shows
Yes,both the task document (that i try to point docTask towards) and the note document (that I want to read the UNID reference to task from), are already saved and closed documents.
This method is reliable and the UNID is really unique (not that uniqueness is the issue here). Is it possible that your code is looking for the document in a replica of the database that hasn’t yet received the document?
The databases resides on the server, so it should basically not be this issue causing.the problem.
However, you may possibly have a point here, as there are some local replicas of some of the databases involved, and there are some OpenByReplicaId statemenst involved in the code in some other functions that are called somewhere else. However, the Open Replica of all the relevant bookmarks currently refer to the database replicas, so I would not think this is the problem, but I shall look into this more deeply.
Thanks for the input!
And for the UniqueID being unique, well…
It took me quite some time some years ago to discover that a field that had been set by the unique @ReplicaId gave incorrect result when using the field value in a db.OpenByReplicaID – because Lotus Script doesn’t understand the colon in the middle of the ID that is allways presented elsewhere in the system, including from @ReplicaID.