Skip to Main Content
HCL Domino Ideas Portal

Welcome to the #dominoforever Product Ideas Forum! The place where you can submit product ideas and enhancement request. We encourage you to participate by voting on, commenting on, and creating new ideas. All new ideas will be evaluated by HCL Product Management & Engineering teams, and the next steps will be communicated. While not all submitted ideas will be executed upon, community feedback will play a key role in influencing which ideas are and when they will be implemented.

For more information and upcoming events around #dominoforever, please visit our Destination Domino Page

Status Needs Clarification
Workspace Domino Designer
Categories LotusScript
Created by Guest
Created on Nov 30, 2020

The ability to disable notes cache to get objects by lotusscript

When retrieving a document in LotusScript, the cache may return an old document.

For example , this problem occurs bt the following steps and codes.

Codes:

(Decralations)

Dim doc as NotesDocumet

(Click)

Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Set db = session.CurrentDataBase
Set collection = db.UnprocessedDocuments
Set doc = collection.getFirstDocument

Stesps:

  1. UserA runs this code.

  2. UserB edit and save the document.

  3. UserA runs this code again.

Result:

Old document is returned at Step3.

The modification of Step2 is not reflected, and the document at Step1 is returned.

  • Attach files
  • Guest
    Reply
    |
    Feb 16, 2021

    The Delete statement explicitly removes the doc from the client cache. So if you need to reload the doc from the database, follow these steps:

    noteid = doc.NoteId

    Delete doc

    Set doc = db.GetDocumentByID(noteid)

  • Guest
    Reply
    |
    Dec 24, 2020

    For example. You have a form, and there is an action in which the code receives the selected documents in an embedded view. So in another way you will not get the selected documents from the action on the form.

    Transferring the action to the embedded view is not a solution - you lose the ability to fully work with the current document. Such a elementary line 100% crashes the Notes Client:

    Call NotesUIDocument.Refresh()

  • Guest
    Reply
    |
    Dec 24, 2020

    @Thomas Hampel

    1. NotesDatabase.UnprocessedDocuments are used because it first returns the marked documents (NotesUIView.Documents), and if there are no such documents, then the document on which the cursor is located (by notesUIView.CaretNoteID). It is very comfortable. The UnprocessedDocuments method according to the documentation should work like this for UI, but for some reason it works the same way as for server or background agents...

    2. db.getDocumentByUNID (doc.universalid) - then one will have to change the program code everywhere so that it receives the document twice. This is not serious.

  • Admin
    Thomas Hampel
    Reply
    |
    Nov 30, 2020

    The collection is built when you set collection = ...

    How about using a NotesView to process documents top down?

    or how about fetching the current version of the document by retrieving a new instance, e.g. using

    set doc2 = db.getDocumentByUNID (doc.universalid)