软件开发办公自动化

数据字段同步问题

现在需要把主表单的一些域,添加到行明细里。

两个视图:1:主表单视图

                  2:行项目视图

取主表单视图:根据每个主表单的KEYUNID去行项目视图里找出对应的行名细文档,

                        进行增加域的操作;就是不能更新成功,麻烦哪位大神看看下面代码,哪里有问题,谢谢!

Dim session As NotesSession

Dim db As NotesDatabase       

Dim view As NotesView       

Dim vc As NotesDocumentCollection       

Dim view1 As NotesView               

Dim doc As NotesDocument               

Set F = New f_default       

Set session = New NotesSession       

Set db = session.CurrentDatabase       

Set view1=db.Getview("v_all_zhu")       

Set view=db.getview("v_hangmingxi")'主表单视图       

        '循环取视图中的主表单       

Set doc =view1.Getfirstdocument()       

While Not (doc Is Nothing )               

Set vc = view.Getalldocumentsbykey(doc.Getitemvalue("KEYUNID"), True)                       

MsgBox doc.Getfirstitem("REQUESTNUMBER").Text               

For i=1 To vc.Count       

Call vc.Getnthdocument(i).Appenditemvalue("REQUESTNUMBER",doc.Getitemvalue("REQUESTNUMBER"))                       

Call vc.Getnthdocument(i).Appenditemvalue("creater_show",doc.Getitemvalue("creater_show"))                       

Call vc.Getnthdocument(i).Appenditemvalue("EmployeeDept",doc.Getitemvalue("EmployeeDept"))                       

Call vc.Getnthdocument(i).Appenditemvalue("System",doc.Getitemvalue("System"))                       

Call vc.Getnthdocument(i).Appenditemvalue("BGType",doc.Getitemvalue("BGType"))

          Call vc.Getnthdocument(i).Appenditemvalue("Other",doc.Getitemvalue("Other"))                       

Call vc.Getnthdocument(i).Appenditemvalue("HuiQianUser_Show",doc.Getitemvalue("HuiQianUser_Show"))                        Call vc.Getnthdocument(i).Appenditemvalue("Status",doc.Getitemvalue("Status"))                       

Call vc.Getnthdocument(i).Appenditemvalue("CreateTime", doc.Getitemvalue("CreateTime"))                                               

Call vc.Getnthdocument(i).Save(True,True)                                        Next       

          Set doc = view1.Getnextdocument(doc)        

Wend                      

End Sub

参与9

2同行回答

x675412x675412研发工程师失业
取的是第一列的值。,切是排序的。 显示全部

取的是第一列的值。,切是排序的。

收起
IT其它 · 2016-03-18
浏览948
  • 恩,这个已经改过来了,以前一直没注意这点,谢谢了
    2016-03-18
yuxiaoxuyuxiaoxu软件开发工程师上海理想
这个应该看你的视图排序列设计了。显示全部

这个应该看你的视图排序列设计了。

收起
软件开发 · 2016-03-15
浏览870

提问者

qing136
其它

相关问题

相关资料

问题状态

  • 发布时间:2016-03-15
  • 关注会员:3 人
  • 问题浏览:2355
  • 最近回答:2016-03-18
  • X社区推广