如何通过Lotusscript来改变一个view里面的特定文档的域的值

请教,文档设计为在中部有一个嵌入的试图,里面保存了另外的一些文档作为该文档的一些子数据。
中间嵌入的视图保存很多文档,但是在这里显示的就是有requester(一个域)为该当前申请人的文档(自己创建的)。现在我想如果在提交的时候通过一个判断窗口然后如果选择是的话就会把该表单里面的Secretary域的值赋到Requester域上去。但是下面注释里的好像不能够修改,因为没有选择到真正的文档。只是拿出来赋值什么的。所以想请教大家有什么好的代码。下面是我那个函数的代码。谢谢! 如果有任何信息的需要,请随时回复我。

还有想问问能通过Entry来找到相应的文档吗?谢谢
Sub Click(Source As Button)
        uidG.EditMode = False
        
        Dim viw As NotesView
        Dim enc As NotesViewEntryCollection
        Set viw = dbG.GetView("veItinerary")
        
        Call viw.Refresh
        Call uiwG.ViewRefresh
        Set enc = viw.GetAllEntriesByKey(uidG.Document.CaseNum(0), True)
        
        If enc.Count = 0 Then
                Msgbox "Cannot submit. No itinerary created yet.", MB_ICONEXCLAMATION, "Input Check"
        
        Else        
                
                Dim x As Integer
                Dim tmpdoc As NotesDocument
                Dim docC As NotesDocumentCollection
                Set docC = viw.GetAllDocumentsByKey(uidG.Document.CaseNum(0), True)        
                
%REM
                If Msgbox(|Do you want your Travel Itinerary be raised to claim by your secretary?  (Note: If yes then the itinerary's requester will be changed to your secertary)|, MB_YESNO+MB_ICONQUESTION+MB_DEFBUTTON2, "Confirmation") = IDYES Then
                        'Set tmpdoc = docC.GetFirstDocument
                        Set tmpdoc = viw.GetFirstDocument
                        While Not tmpdoc Is Nothing
                                If tmpdoc.Secretary(0) = "" Then
                                        Msgbox "You didn't input anyone as your Secretary!"
                                        Exit Sub
                                Else
                                        tmpdoc.Requester = tmpdoc.Secretary(0)
                                        tmpdoc.Save True, True
                                End If
                                
                                Set tmpdoc = docC.GetNextDocument(tmpdoc)
                        Wend
                End If
%END REM
                
                For x = 1 To enc.Count
                        If enc.GetNthEntry(x).ColumnValues(6) <> "" Then
                                Msgbox |Cannot submit. At least one itinerary with not all compulsory fields filled. You can see it from the current "Travel Itineraries" view.|, MB_ICONEXCLAMATION, "Input Check"
                                Exit Sub
                        End If                        
                Next x
                
                tmpEditG = True
                uidG.EditMode = True
        End If        
End Sub
参与3

1同行回答

AaronXueAaronXue软件开发工程师阿三在
这里还有一段Global的声明和初始化。 Dim nsG As NotesSession Dim dbG As NotesDatabase Dim uiwG As NotesUIWorkspace Dim uidG As NotesUIDocument Dim tmpEditG As Variant Sub Initialize         Set nsG = New NotesSession       &...显示全部
这里还有一段Global的声明和初始化。
Dim nsG As NotesSession
Dim dbG As NotesDatabase
Dim uiwG As NotesUIWorkspace
Dim uidG As NotesUIDocument
Dim tmpEditG As Variant

Sub Initialize
        Set nsG = New NotesSession
        Set dbG = nsG.CurrentDatabase        
        Set uiwG = New NotesUIWorkspace
End Sub
收起
软件开发 · 2015-06-15
浏览1217

提问者

AaronXue
软件开发工程师阿三在

相关问题

相关资料

问题状态

  • 发布时间:2015-06-15
  • 关注会员:2 人
  • 问题浏览:4685
  • 最近回答:2015-06-15
  • X社区推广