I have a agent to approve my form. In that agent I have a function to check if the form satisfies all condition . I have to check one condition like if the type is a valid one or not, for that I have to get the valid type from a vie called types and check if the form type is one among that type.
I have written function code like this and when I run I get variant does not contain an object error…
Function getStatus(doc As NotesDocument) As String
Dim myflag As Integer
Dim data As String
'for getting equipment codes
Dim eview As NotesView
Dim edoc As NotesDocument
Set eview = db.GetView("lookupEquipment")
myFlag=False
data=""
goodfont$=|<B><FONT COLOR="Blue" SIZE=1 FACE="Verdana">|
badfont$=|<B><FONT COLOR="Red" SIZE=1 FACE="Verdana">|
' for checking equipment code
Set edoc = eview.GetFirstDocument
Dim ecode As Variant
Dim ecodeorg As Variant
'check to make sure account codes are correct
With doc
If (.acct_type(0)="CAPITAL") myFlag=True
data="Incorrect account type"
End If
If (.frm_type(0)="") Then
myFlag=True
data="Missing Type"
If edoc Is Nothing Then
ecodeorg=edoc.Equipment_code
If (.frm_type(0)=ecodeorg) Then
myFlag=True
data = "Valid Type"
End If
Set edoc = eview.GetNextDocument(edoc)
End If
End If
End With
If myflag Then
flag=True
getStatus=badfont$+data
Else
getStatus=goodfont$+"Successful Validation"
End If
End Function
Please help