請幫忙。我在表單中有一個querysave事件。下面是代碼片段。它是用於計算一個參考號(編號結算),其格式爲「ST115-00001」 子QuerySave的(來源如Notesuidocument,繼續作爲變型)公式填充值中的值
Dim w As New notesuiworkspace
Dim uidoc As notesuidocument
Dim SESS As New NotesSession
Dim RefView As NotesView
Dim DB As NotesDatabase
Dim RefDoc As NotesDocument
Set DB = SESS.CurrentDatabase
Set RefView = DB.GetView("System\AutoNo")
Set uidoc=w.CurrentDocument
Dim approvedcnt As Integer
approvedcnt = Cint(source.fieldgettext("appcnt"))
If uidoc.EditMode = True Then
Financial_Year = Clng(Right$(Cstr(Year(Now)),3)) + 104
If Month(Now) >= 4 Then Financial_Year = Financial_Year + 1
DocKey = Cstr(Financial_Year)& "-"
New_No = 0
Set RefDoc = RefView.GetDocumentByKey(DocKey , True)
If Not(RefDoc Is Nothing) Then New_No = Clng(Right$(RefDoc,5))
New_No = New_No + 1
autono = DocKey & "-" & Right$("00000" & Cstr(New_No) ,5)
Application ="ST"
Latest_No = Application + autono
Call uidoc.FieldSetText("SETTLEMENT_NO",Latest_No)
Call uidoc.Refresh
Else
Exit Sub
End If
get_ex_rate
get_cv_local
Call uidoc.FieldSetText("Flag1", "A")
If approvedcnt = 12 And uidoc.FieldGetText("STATUS") = "APPROVE" Then
Call uidoc.fieldsettext("Flag2", "B")
End If
Dim answer2 As Integer
answer2% = Msgbox("Do you want to save this document?", 1, "Save")
If answer2 = 1 Then
Print "Saving"
End If
If answer2 = 2 Then
continue=False
Exit Sub
End If
uidoc.Refresh
uidoc.close
結束子
我需要DocKey的值和New_No被填充到視圖。我應該使用什麼公式,並且是我的邏輯正確的。請幫忙。
Regards, Priya。
看起來你只需要在你的視圖中添加settlement_no項作爲一個列?或者,如果您想在您的視圖中使用dockey和new_no,只需將它們保存到文檔中,就像您爲結算編號所做的一樣。 –