doc复制的问题
初学notes,写了包含4个Form的申请流程程序(即程序流程是从Form1->Form2->Form3->Form4构成一条申请的记录),现在我想做一下性能测试,需要制作10000条数据。因为程序分为前台和后台(即前台有公式写的代码,后台有代理代码),所以我写了一个Action,作用是自动循环填写4个Form上各个Form的字段,最后保存。但是这个循环最大次数为28条(即Form1->Form2->Form3->Form4 * 28),超过28条Domino服务器就报异常了,个人怀疑是否工作区有最大打开文档的限制(28*4=112)。以下为代码片断,请高手赐教,若有其他好的方法来自动生成记录更好。
Sub Initialize
Dim session As New NotesSession
Dim uiwork As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUiDocument
Dim i As Integer
Set db = session.CurrentDatabase
For i = 0 To 27
'Doc1 ------------------------------------
Set uidoc = uiwork.ComposeDocument( ,,"Doc1" )
Dim cdoc1 As NotesDocument
Set cdoc1 = uidoc.document
cdoc1.Form = "Doc1"
cdoc1.Field1 = "Doc1.Field1"
cdoc1.Field2 = "Doc1.Field2"
Call uidoc.Save
Call uidoc.close
'Doc2 ----------------------------
Set uidoc = uiwork.ComposeDocument( ,,"Doc2" )
Dim cdoc2 As NotesDocument
Set cdoc2 = uidoc.Document
cdoc2.Form = "Doc2"
cdoc2.Field1 = "Doc2.Field1"
cdoc2.Field2 = "Doc2.Field2"
Call uidoc.Save
Call uidoc.close
'Doc3 ----------------------------
Set uidoc = uiwork.ComposeDocument( ,,"Doc3" )
Dim cdoc3 As NotesDocument
Set cdoc3 = uidoc.Document
cdoc3.Form = "Doc3"
cdoc3.Field1 = "Doc3.Field1"
cdoc3.Field2 = "Doc3.Field2"
Call uidoc.Save
Call uidoc.close
'Doc4 ----------------------------
Set uidoc = uiwork.ComposeDocument( ,,"Doc4" )
Dim cdoc4 As NotesDocument
Set cdoc4 = uidoc.Document
cdoc4.Form = "Doc4"
cdoc4.Field1 = "Doc4.Field1"
cdoc4.Field2 = "Doc4.Field2"
Call uidoc.Save
Call uidoc.close
Next
End Sub --------------------编程问答-------------------- 没有测试过,不过常规是用backend的方法
set doc=db.createDocument()
doc.form="AAA"
doc.item1="1"
doc.item2="2"
doc.item3="3"
doc.computeWithForm(false,false)
call doc.save(false,false)
--------------------编程问答-------------------- 建议你写个代理后台执行
补充:企业软件 , Lotus