Hi,I want to check a notesdatabase for double documentuniqueid’s
My code:
strUNID = copyDoc.UniversalID
set tmpDoc = mydatabase.GetDocumentByUnid(strUNID)
As result for a not-found UNID I was hoping for an empty tmpDoc object which I could check with “if tmpDoc is nothing then …”
Instead, when the UniversalID is not found, Notes creates an error that stoppes my code alltogether(“Invalid Universal ID”)
What would be the “code-friendly” way to check for the availability of a documentUniqueID??
Thnx
Arthur
Subject: check for DocumentUniqueID
Two documents in the same database absolutely cannot have the same UNID, so there’s really no point checking.
As for trapping a partcular error in a friendly way:
On Error Goto HandleSpecificError
SafeResumePoint:
HandleSpecificError:
Resume SafeResumePoint
Subject: RE: check for DocumentUniqueID
Hi Stan,
Thnx a lot for your response. Tried it and works great.
A little background to my question: my customer has been, simultaneously, adding documents in version A (test-environment) and version B (live-server) of the same database.
They now want to move documents from A > B.
Since documents are connected in a parent-response way I was afraid to loose this connection when copying.
Therefore a want to change the id’s of the copied documents with a little script that
1/ reads the original UNID form a field in the copy-doc
2/ checks for its existance in the live-db. If not yet available:
3/ re-creates the document (using the original UNID)
2/ deletes the original doc
Makes sense??
Arthur
Subject: check for DocumentUniqueID
when u are accessing uniid first thing u shd convert to string then only u dont get ant error
the bset way is use agent to check for uniid
or u create a column in the view and keep that value as @text(@DocumentUniqueID) from this column you can check the
doc ids
i hope this will help u
9731055656
Subject: RE: check for DocumentUniqueID
Hello Reddy,
Your soution is so simple that I am ashamed not to have thought of it myself :))
Thnx,
Arthur