I need to test a field (DocumentTypeTX) and switch forms (to PricingAgreement) if the field contains"Pricing Agreement" I cannot use a form formula because there are too many existing views. I thought I could handle this in the Postopen event using the following code, but I get an “Operation Failed” error on the Evaluate statement. I get the same error in the Queryopen event.
Sub Postopen(Source As Notesuidocument)
'if DocumentTypeTX = "Pricing Agreement" then switch forms to PricingAgreement
Dim s As New NotesSession
Dim doc As NotesDocument
Set doc = source.Document
If doc.DocumentTypeTX(0) = "Pricing Agreement" Then
Dim ret As Variant
Dim evalstring As String
evalstring = |@Command( [SwitchForm] ; "PricingAgreement"|
ret = Evaluate( evalstring, doc)
End If
End Sub