Hi
I have been looking at the numerous questions regarding composing forms but I think I have the only option not yet covered so I hope soemone can help me. I am not good at LotusScript so if I need to use that please give me all the code so I can modify it to suit.
Basically I am filling in the common parts of three forms and then working on each of the forms individually after the start. Each company may have up to three profile forms.
I have a requirement to create one or multiple new forms using one submit button with total inheritance of the initial Customer Capture form into all the forms created. For example - field “fProfile” can contain “export” or “import” or “other” or any combination of the three. If it has “export” then I want the Export form composed and all the fields inherited, (I have inheritance switched on and the field names match) but if the fProfile field has “export” and “import” I need both forms created, and so on to include all three forms if necessary. Once this is done I no longer need the original form and want to actually delete it. If I can do this in Formula that would be great - but if I need LS so be it.
Thanks in advance. Hope I explained it OK.
Regards
Tim
Subject: Composing Multiple Documents
Use the NotesSession.DocumentContext to get a handle to the in-memory document (on web use webQuerySave
than use the createDocument Method of notesdatabase to create the new documents
here is a bodgey sample
Dim session As NotesSession
Dim db as NotesDatabase
Set session = New NotesSession
set db=session.CurrentDatbase
Dim doc As NotesDocument
Set doc = session.DocumentContext
Dim newDoc as NotesDocument
set newDoc=db.CreateDocument
newdoc.Form=“myForm”
newdoc.fProfile=doc.fProfile(0)
Call newdoc.Save(True,False)
End Sub
Hope that gets you started
Tim
Subject: RE: Composing Multiple Documents
Hi TimThanks very much for your input. That is the way of achieving inheritance but does not solve my problem of selectively creating multiple documents from different forms.
Regards
Tim Norris
tnorris@notesafrica.co.za
Subject: RE: Composing Multiple Documents
Is this more what you are after?
Dim session As New NotesSession
Dim db As NotesDatabase
Dim success As Boolean
Dim doc As NotesDocument
Dim NewDoc As NotesDocument
Dim fProfile As NotesItem
Dim otherFieldToCheck As NotesItem
Set doc=session.DocumentContext
Set fprofile=doc.GetFirstItem(“fProfile”)
Set otherFieldtoCheck=doc.GetFirstItem(“OtherField”)
Forall actions In fProfile.Values
Set newdoc=db.CreateDocument
Select Case actions
Case export
newDOc.Form="Export"
Case Import
newDOc.Form="Import"
End Select
'add other values from doc here
Call newDoc.Save(True,False)
End Forall
Forall actions In otherFieldtoCheck.Values
Set newdoc=db.CreateDocument
Select Case actions
Case invoice
newDOc.Form="invoice"
Case reminder
newDOc.Form="reminder"
End Select
'add other values from doc here
Call NewDoc.Save(True,False)
End Forall