OK, I’ve been searching all morning through the Help and this forum and still cannot find an answer to my problem.
I want to prevent a user from editing a document if the Status=“COMPLETE”, unless the user has the userrole of [Manager].
What is the easiest way to do this? And where does the code go? Either a LotusScript or @Formula solution will work for me.
I have this code in the QueryModeChange of the form but it doesn’t check the user role or prevent the user from editing the document with a Ctrl-E from the view:
If Not ( source.EditMode ) Then
currentStatus = source.FieldGetText( “Status” )
If ( currentStatus = "COMPLETE" ) Then
Messagebox ( "You are not authorized to edit a Request with the status of COMPLETE." )
continue = False
End If
Well, there should be. Consider Editor access an anomoly, something most users should never see in applications. Author access andAuthors-type fields will handle af of these who-can-edit-what-when problems easily.
Assuming that no-one had Author access, no-one not listed in the Authors field could edit the document. If all that is in the Authors field is the “[Manager]” role, then you don’t need to worry about coding any events.
I guess in case you neeed to Trap the CTRL+E also then QueryMode change will not fire but you either need to write on the QueryOpen or the PostQueryOpen Event of the Form.
Yes, Authors fields is the best approach in case your ACL is allowing that, I mean from the Previous design implications.