hi,i have 32 bit id from that i wann to create 4 document(child)
and delete orignal document
e.g
in master 32 bit address and coressponding subnet value stored
in another from has dblookup, here get 32 bit address and their subnet from master here one buttin divide it divides that address into 4 address, i wann to create 4 document for that address and wann to delete orignal one how i will do this
plz help me
Subject: how i create 4 document(child) from orignal document
Here one example:
This code will create the four response documents for the document selected.
Dim session As New notessession
Dim db As notesdatabase
Dim view As notesview
Dim collection As notesdocumentcollection
Set db = session.currentdatabase
Dim docA As notesdocument
Set view = db.getview("All Docs")
Set collection = db.unprocesseddocuments
Set docA = collection.getfirstdocument
While Not docA Is Nothing
Dim docB As New notesdocument(db)
Dim a As String
Dim b As String
Dim h As String
a = docA.assettest(0)
b = docA.assettest_1(0)
h = docA.code(0)
'1st responsed doc
Call docB.MakeResponse(docA)
docB.Form = "test3"
docB.subject = a
docB.test = b
Call docB.save (True, True)
'2nd response doc
Dim docC As New notesdocument(db)
Call docC.MakeResponse(docA)
docC.Form = "test3"
docC.subject = a
docC.test = b
Call docC.save (True, True)
'3rd response doc
Dim docD As New notesdocument(db)
Call docD.MakeResponse(docA)
docD.Form = "test3"
docD.subject = a
docD.test = b
Call docD.save (True, True)
'4th response doc
Dim docE As New notesdocument(db)
Call docE.MakeResponse(docA)
docE.Form = "test3"
docE.subject = a
docE.test = b
Call docE.save (True, True)
Set docA = collection.getnextdocument (docA)
Wend
You will need to create another code to go thru the view and delete the main document IF it has the four response documents. You might could delete the document after it creates the response documents; however, I wouildn’t do it simply because if something happens, you’d delete the main document and no responses were created.
Hope this helps.