I want to set the document mode onclick dynamically.
When I click a button, the onclick action is "Change Document Mode",In which we have 4 options to select.
But Beside this the computed property button is provided, Below image can make the query more clear.
In the computed property button it is allowed to write ssjs code,
So I am not getting that, what keyword should I return there for all the four option to be in working according to condition.
The sample code which I was trying to get the edit mode is:
var uid = context.getUrlParameter("documentId");
var doc:NotesDocument = database.getDocumentByUNID(uid);
if(doc.getItemValueString("$$disabled") != "true") {
// want to return the Edit Mode
return "Edit Mode "
} else {
// do nothing
return false;
}
Any valuable suggestions would be appreciated.
You can see which value is set for a selected document mode if you switch to Source tab.
This is the list of the options and its internal values:
Toggle ======> toggle
Read Mode ===> readOnly
Auto Edit ===> autoEdit
Edit Mode ===> edit
You would return "edit"
in your code if you want to switch to Edit Mode
for example.