Here’s my original code and it works great to create this new document while inheriting values from the source document.
I would like the code to force the new doc to run through the event codes … like PostOpen, QueryModeChange …etc when I create the doc. I need the creation of this new doc to act like I’m creating it with the @Command([Compose]).
Do I need to throw something like this in the code? The syntax is wrong but this is the idea.
Call PostOpen(tdoc)
Call QueryModeChange(tdoc)
Sub Click(Source As Button)
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim tdoc As NotesDocument
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Dim boxdoc As NotesDocument
Dim newudoc As NotesUIDocument
Dim tmsg As Variant
Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document
Set tdoc = db.CreateDocument
tdoc.Form = "Account Open - Transfer"
tdoc.AccountNbr=uidoc.FieldGetText("accountnbr")
tdoc.MailType=uidoc.FieldGetText("MailType")
tdoc.CustomerID=uidoc.FieldGetText("CustomerID")
tmsg= ws.DialogBox("db-TransferNew", True, True, False, False, False, False, "Set Up New Transfer", tdoc)
If tmsg = True Then
tdoc.ComputeWithForm False, False
Call tdoc.Save (True, True)
Call ws.EditDocument(True, tdoc)
End If
End Sub