我正在开发一个在框架集中打开文档的 Domino 客户端应用程序。
当我单击保存按钮时,它会进行一些莲花脚本验证,添加到历史字段等,然后最后进行保存:
Sub Click(Source As Button) Dim validate1 As Validation Dim As New NotesUIworkspace Dim s As New NotesSession
Dim uidoc As NotesUIDocument Dim approverNames As String Dim workflow1 As Workflow
Dim name1 As String Dim names1 As String Dim item1 As NotesItem Dim history1 As History
Set uidoc = ws.CurrentDocument
Call uidoc.refresh
'===============================================
'Validation
'===============================================
Set validate1 = New Validation()
Call validate1.checkCustomer(uidoc.FieldGetText("Customer"))
Call validate1.checkEndUser(uidoc.FieldGetText("EndUser"))
Call validate1.checkShortProjectDescription(uidoc.FieldGetText("ShortProjectDescription"))
Call validate1.checkProjectName(uidoc.FieldGetText("ProjectName"))
Call validate1.checkProjectLocation(uidoc.FieldGetText("ProjectLocation"))
Call validate1.checkOperationCenter(uidoc.FieldGetText("BusinessUnit"))
Call validate1.checkSalesCenter(uidoc.FieldGetText("SalesCenter"))
Call validate1.checkMarketSegment(uidoc.FieldGetText("MarketSegment"))
Call validate1.checkSAPDate(uidoc.FieldGetText("SAPDate"))
Call validate1.checkRevision(uidoc.FieldGetText("Revision"))
Call validate1.checkValidityDate(uidoc.FieldGetText("ValidityDate"))
Call validate1.checkDateApproval(uidoc.FieldGetText("DateApproval"))
Call validate1.checkCurrencyUSD(uidoc.FieldGetText("CurrencyUSD"))
Call validate1.checkMargin(uidoc.FieldGetText("Margin"))
If validate1.displayErrorMessages() = 0 Then
'========================================================================
Call uidoc.FieldSetText("WhoHasApproved","")
Call uidoc.FieldSetText("ApproversNotified","")
Call uidoc.FieldSetText("SubmitDate",Cstr(Now))
Call uidoc.FieldSetText("Status","In Process")
'Add calls to workflow here....
Set workflow1 = New workflow("SAPFCD")
'Update History Field - Submitted for Processing by
Set history1 = New History(uidoc.Document)
Call history1.addTo("Submitted for Processing", uidoc.FieldGetText("CreatedBy"))
Set item1 = uidoc.Document.ReplaceItemValue("History" , history1.getDescription())
'Set ApproverList
names1 = workflow1.setApproverList(uidoc)
Call uidoc.FieldSetText("ApproverList",names1)
uidoc.Refresh
name1 = workflow1.setNextApprover(uidoc)
Call uidoc.FieldSetText("NextApprover", name1)
'========================================================================
'Add calls to workflow here....
Call uidoc.FieldSetText("Status","1st Peer")
uidoc.Save
uidoc.Close(True)
uidoc.Close(True)
End If
结束子
然后继续关闭整个数据库并将用户返回到工作区。
我想要的是保存文档,然后将用户返回到框架集中的指定页面。
我试图将这样的代码添加到 QuerySave 事件中,但不起作用:
Sub Queryclose(Source As Notesuidocument, Continue As Variant) Dim ws As New NotesUIworkspace
ws.OpenFrameSet("MainFrame") ws.SetTargetFrame("Main")
ws.OpenPage("Saved") End Sub
关于如何在不关闭整个数据库的情况下保存/关闭框架集中的 UI 文档的任何想法。
德里克