Why does this line:v$ = source.FieldGetText(Listtag(F))
produce the error above?
This is part of a piece of code that compares the document’s current field values to its previous field values (taken in the OnLoad event of the form), to check whether any changes have been made. (This is recycled code, by the way.)
Forall F In listPrev
v$ = source.FieldGetText(Listtag(F))
If m$ = "" Then
m$ = session.CommonUserName & " - " & Cstr(Now()) & " = modified "
Else
m$ = m$ & ", "
End If
If F = "" Then F = {""}
xxx = v$
If xxx = "" Then xxx = {""}
'MyTag is used for display in the audit trail of the user friendly field name, instead of the field name itself
'If Listtag(F) = "SIRStatus1" Then
' MyTag = "Status"
If source.FieldGetText("tStatus1") = "Reopened" Then
If source.FieldGetText("Assigned_To") = "" Then
Else
sendflag = True
End If
End If
'If Listtag(F) = "SysName" Then MyTag = "System Name"
'If Listtag(F) = "DateReported" Then MyTag = "Date Reported"
'If Listtag(F) = "SIRSeverity" Then MyTag = "Severity"
'If Listtag(F) = "SRNNo" Then MyTag = "SRN Found"
'If Listtag(F) = "SIRPriority" Then MyTag = "Priority"
'If Listtag(F) = "TestPhase" Then MyTag = "Test Instance"
'If Listtag(F) = "AssignTo" Then
' MyTag = "Assigned To"
If source.FieldGetText("Assigned_To") = "" Then
Else
sendflag = True
End If
'End If
'If Listtag(F) = "SIRResolution" Then MyTag = "Resolution"
'If Listtag(F) = "SRNResolved" Then MyTag = "SRN Resolved"
'If Listtag(F) = "DateSolved" Then MyTag = "Date Resolved"
m$ = m$ & Listtag(F) & " from " & F & " TO " & xxx
'End If
F = V$
End Forall
listPrev was earlier declared as a List of type String. The code in my OnLoad event is this:
Set session = New NotesSession
bDocSend = False
‘Store fields’ previous values, which will be used for tracking changes upon saving.
'listPrev(“System Name”) = source.FieldGetText(“tSys_Name”)
listPrev(“SIR Status”) = source.FieldGetText(“tStatus1”)
listPrev(“Date Reported”) = source.FieldGetText(“DateReported”)
listPrev(“Severity”) = source.FieldGetText(“cboSeverity”)
listPrev(“SRN Found”) = source.FieldGetText(“tSRN_Found”)
listPrev(“Priority”) = source.FieldGetText(“cboPriority”)
listPrev(“Instance”) = source.FieldGetText(“cboInstance”)
listPrev(“Assigned To”) = source.FieldGetText(“Assigned_To”)
listPrev(“Resolution”) = source.FieldGetText(“tResolution”)
listPrev(“SRN Resolved”) = source.fieldgettext(“tSRN_Resolved”)
listPrev(“Date Resolved”) = source.FieldGetText(“dDateSolved”)