Single response document

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?

<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.

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

Processing your response...

Discuss This Question: &nbsp

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

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

Processing your reply...

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

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

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

Share this item with your network:

To follow this tag...

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