You can use LotusScript in the action to check this. For instance:
<pre>Static lastResponse As NotesUIDocument
If not (lastResponse Is Nothing) then
‘ they already used this button and the document they opened then is still open.
Msgbox “You are already editing a response to this document in another window.”, …
Dim wksp As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set uidoc = wksp.CurrentDocument
Set doc = uidoc.Document
If doc.Responses.Count = 0 Then
Set lastResponse = wksp.Compose(…)
Msgbox “There is already a response to this document.”, …
This should prevent two responses from being created by the same user on the same workstation. However, this doesn’t do anything to prevent multiple users from creating responses from different workstations at the same time. You might use Querysave code somewhat similar to the above to locate the parent document and prevent the save if the parent already has a response, so that only the first user can save their new document. This works provided there’s only one replica. If users are working on multiple replicas, this becomes much more difficult to prevent, and it’s probably better to focus on detecting and correcting it after the fact. If you did want to prevent it, you would probably have to look at using document locking on the main document while the response is being composed.