I need to know, using a formula, if a document is opened in read-only mode (when i use the notesUIWorkspace.EditDocument method with notesDocumentReadOnly set to True).
This is my problem:
I don’t want to show an action if the document is opened in read-only mode.
So, the action must be showed only if the document is not opened in read-only mode.
You say “I don’t want to show an action if the document is opened in read-only mode.”
For each action button you can set the hide when properties, as shown below. So you can hide actions when the document is being read vs being edited. For example, you don’t want to show “Save and Close” as an action when the document is only being read.
Subject: How can I know if a document is opened in read-only mode?
Antonio,
To do what you’re intending, you’ll need to integrate your ACL and authors fields into your hide when formula.
You’ll need to examine the ACL of the database and test for all members of the ACL with author or higher access. You’ll also need to examine that particular document for any authors fields it may contain - if a document contains an authors field and the user (or a group or role in which the user is a member) is not in it, he or she can’t edit the document.
I hope this helps. If you need some sample code let me know and I’ll be happy to put some together for you.
Subject: How can I know if a document is opened in read-only mode?
Since you are opening the document in LotusScript as “read-only” that means that you have an object representing the back end document. I think that you could add a field named “tmpReadOnly” to the doc before you open the ui doc and then use a hide-when formula that tests for that field. You want to mark the tmpReadOnly fields as “do not save to disk” so that it is never stored in the document.