Hi,
as in the subject mentioned, is it possible to check, if a document is opend via a link?
My problem is the following.
In a form the property “Automatically enable Edit Mode” is set.
But under certain conditions this form may only be opened in Read Mode.
I catch this case with the following code in the Postopen Event:
If doc.ActionInAct(0) <> “0” And Source.EditMode = True Then
source.editmode = False
End
end if
If I open the document in the database, everything works fine.
If I open the document via a link from the mail database (an agent sends mails with a doclink in it), then the Queryopen (and the Postopen) event is accessed two! times.
The first cycle runs without problems (means the document is set to Read Mode), on the second cycle the document is still in Read Mode, so the code (source.editmode = false) is not executed.
But (I think because of the automatic edit mode property, but I need this) the document tries to get in Edit Mode.
Querymode change is executed.
There is the code:
If source.document.ActionInAct(0) <> “0” And Source.EditMode = False Then
Messagebox “Das Dokument befindet sich bis zum " & Strright(doc.ActionInAct(0),”§“) & " im Status ““Ruhend”” und kann somit nicht bearbeitet werden!”,64,MsgT
Continue = False
End
End If
The messagebox is executed and then, despite of the “continue=false”, the document is set to Edit Mode.
With R5 there is a different problem. The Events are executed just once, but on opening the document via a link, the “source.editmode = false” command results in an “Document command is not available” error.
Has somebody any ideas?
Greetings
Robert