Save conflicts can be a big problem in Notes/Domino databases. The conflicts usually occur when one or more users open a document with a link that subsequently opens several other times in the Notes client. Here is a three-part solution.
- Set up a simple view that contains all documents in the database within a single column comprised of @text(@DocumentUniqueID) and sorted in ascending order. In my example, the view is called "ByUNID."
- Use the function noConflict (shown below in code) in either the document, a script library or an .LSS file.
- In either the onSubmit or onQuerySave event, use the code "Continue = noConflict( Source )."
If further processing is required, the value of "Continue" allows a developer to branch entries accordingly before exiting. For example, "If Continue = false, then exit sub."
My example is a simple No Conflicts Allowed flow. You can alert the user to the other changes using the NotesItem.LastModified property instead of the user's NotesDocument.LastModified property. You could also use this to merge the documents if the changed fields were different.
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip library by member Jack Swalwell. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes/Domino technical tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.