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 Under Consideration
Workspace Domino Designer
Categories LotusScript
Created by Guest
Created on Aug 8, 2022

ForAll variable to follow type of array element

Sub Initialize
Dim ns As New NotesSession

Dim db As NotesDatabase

Set db= ns.Currentdatabase

ForAll vw In db.Views

If vw....

End ForAll


In this snippet, vw is a Variant and not a NotesView, which is terribly unpractical.

Suggestions:

  • either deduce the correct variable type, or

  • allow vw to be declared

  • Attach files
  • Guest
    Reply
    |
    Sep 19, 2022

    If you use a custom class array then it works as you want and the ForAll variable has the correct type. You can then directly call the methods of that class.

    The problem here is that db.Views is not an Array of NotesView objects, but a Variant. This is because a property in LotusScript cannot be an array or a List (can be any of the scalar data types). If it were possible, the parentheses for selecting an element would be indistinguishable from property parameters.

    The solution is to use a specific variable

    Dim v as NotesView

    Set v = vw

    The advantage is that it can also be referred to after End ForAll, e.g. in an error handler.