Error: User Defined error

HI All,

I am getting an error such as IBM Lotus Notes:-User Defined error , while opening the document by UNID,

My Part of code is as follows–>

Dim uiws As New NotesUIWorkspace

Dim session As New NotesSession



Dim database As NotesDatabase

Dim doc As NotesDocument

Dim uidoc As NotesUIDocument



Set database = session.CurrentDatabase

Set uidoc = uiws.CurrentDocument

'Call uidoc.Refresh

Set doc = database.GetDocumentByUNID(uidoc.FieldGetText("Req_Link"))



Set uidoc=uiws.EditDocument(False,doc)

Any help will be Appreciable !!

I will repost after getting reply !!

Thanks

Rupesh

Subject: More info?

Help me with the context:

Are you editting a document at the time? It looks like it as you’re working with a front end document (uiDoc)

Someone is entering picking Req_Link field (it’s already set?) You should add code to make sure it’s got a value.

Not sure if it’s required for GETUNID but do you have a default view in the DB?

Subject: RE: More info?

in my part of code as in below…

i am also editing document, and i have also default view.

The field Req_link is holding the value of the UNID,

by fetching this unid earlier i was able to open the document,but now its showing “user defined error”,and in another form the same code showing the error message----“Do you want to save the document” so what to do in this condition?

my code—>

Dim uiws As New NotesUIWorkspace

Dim session As New NotesSession



Dim database As NotesDatabase

Dim doc As NotesDocument

Dim uidoc As NotesUIDocument



Set database = session.CurrentDatabase

Set uidoc = uiws.CurrentDocument

'Call uidoc.Refresh

Set doc = database.GetDocumentByUNID(uidoc.FieldGetText("Req_Link"))



Set uidoc=uiws.EditDocument(False,doc)