Tip

Three steps to trap and handle save conflicts with LotusScript

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.

  1. 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."
  2. Related LotusScript resources:
    Troubleshoot agents by displaying LotusScript variables online

    LotusScript sorts lists alphabetically

    Soft-code item names to facilitate LotusScript management

  3. Use the function noConflict (shown below in code) in either the document, a script library or an .LSS file.
  4. 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.

LotusScript to trap and handle save conflicts
(Click on code for enlarged view and script download.)

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.

This was first published in August 2009

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

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
Sort by: OldestNewest

Forgot Password?

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

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.