Domino Code Fragment

Code Name*
Selection Formula for document collection used in db.search
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.19.27.178
Description*
This formula will be used by db.search method to select documents by form and by fields that are equal to some variable sPrimary.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:

Dim session As New NotesSession
Dim dbCur As NotesDatabase
Dim dc As NotesDocumentCollection
Set dbCur = session.CurrentDatabase

'Set search where Form = "Plan" and either of the Primary or FedPrimary fields = the variable sPrimary
SearchFormula$ = "Form = ""Plan"" & Primary = """+ sPrimary +""" | Form = ""Plan"" & FedPrimary = """+ sPrimary +""""
Set dc = dbCur.Search( SearchFormula$, Nothing, 0 )