On document creation, I need to check the contents of a field on field exit against a view to validate information. If the information is in the view, a pop up message is initiated. All was working fine until the view hit about 2700 records. I assumed it had to do with the 64k limit on @dbColumn, so I recoded to use a NotesDocumentCollection instead. In both instances, it works fine until 2700 entries in the view, and then it just doesn’t seem to work. No errors, it just moves on past the field with no validation. I’ve debugged it, and don’t see any errors.
Original Code:
Sub Exiting(Source As Field)
' checks GrpName and GrpNmDom fields against Sailpoint view to direct csr to Sailpoint if required - mb 5/2014
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim dc As notesDocumentCollection
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim item As NotesItem
Dim db As NotesDatabase
Dim MatchView As NotesView ' view to pick GroupName and Domain from
Dim EGrpCk As Variant, EDomCk As Variant 'Variables to hold results of GrpCk and DomCk
Dim cmd As String, DPlusGp As String
Dim GrpName As String, GrpNmDom As String, GrpNm As String, GrpDom As String, SailPointCk As String 'fields in the form
Dim BoxType As String, BoxMsg As String
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set MatchView = db.getview("Sailpoint")
Set doc = MatchView.GetFirstDocument
GrpNm = uidoc.FieldGetText("GrpName")
GrpDom= uidoc.FieldGetText("GrpNmDom")
DPlusGp = GrpDom + " " +GrpNm
uidoc.Refresh
EGrpCk = Evaluate( {@Trim(@unique(@DbColumn("":""; "";"Sailpoint"; 3)))},doc)
uidoc.Refresh
BoxMsg = |Management of this group has been moved to Sailpoint.
This request will not be saved in this database.
For help with removal of IDs, Groups inside other groups or Generic ID provisioning, see SailPoint Help. |
Forall r In EGrpCK
If r = DPlusGp Then
Messagebox BoxMsg, MB_ICONSTOP, "SAILPOINT ALERT"
Call uidoc.FieldSetText("SailPointCk","Yes")
uidoc.Refresh
Call uidoc.FieldSetText("GrpName", "")
Call uidoc.GotoField("GrpName")
End If
End Forall
End Sub
Modified code using Document Collection
Sub Exiting(Source As Field)
' checks GrpName and GrpNmDom fields against Sailpoint view to direct csr to Sailpoint if required - mb 5/2014
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim dc As notesDocumentCollection
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim item As NotesItem
Dim db As NotesDatabase
Dim MatchView As NotesView ' view to pick GroupName and Domain from
Dim EGrpCk As Variant, EDomCk As Variant 'Variables to hold results of GrpCk and DomCk
Dim cmd As String, DPlusGp As String
Dim GrpName As String, GrpNmDom As String, GrpNm As String, GrpDom As String, SailPointCk As String 'fields in the form
Dim BoxType As String, BoxMsg As String
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Set MatchView = db.getview("Sailpoint")
Set doc = MatchView.GetFirstDocument
GrpNm = uidoc.FieldGetText("GrpName")
GrpDom= uidoc.FieldGetText("GrpNmDom")
DPlusGp = GrpDom + " " +GrpNm
uidoc.Refresh
Set dc = matchview.GetAllDocumentsByKey(GrpNm,True)
uidoc.Refresh
BoxMsg = |Management of this group has been moved to Sailpoint.
This request will not be saved in this database.
For help with removal of IDs, Groups inside other groups or Generic ID provisioning, see SailPoint Help. |
Do Until GrpNm <> ""
Messagebox BoxMsg , MB_ICONSTOP, "SAILPOINT ALERT"
Call uidoc.FieldSetText("SailPointCk","Yes")
uidoc.Refresh
Call uidoc.FieldSetText("GrpName", "")
Call uidoc.GotoField("GrpName")
Set doc = MatchView.GetNextDocument(doc)
Loop
End Sub
Any suggestions would be appreciated. Ultimately the view will have about 20,000 entries. The view itself is very simple, just 2 columns with the 1st one being sorted.