Single response document

90 pts.
Tags:
Domino Designer
Hey, I would like it so that only one responce document can be created. I am currently using an action button to open the new responce from. So ideally if te button is pressed and a responce document already exsists for this document I would like it to stop a responce opening and give an error message. Does anyone know how to acheive this in formula?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.”, …
Else
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(…)
Else
Msgbox “There is already a response to this document.”, …
End If
</pre>

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.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following