도와주세요. 나는 형태로 querysave 이벤트를 가진다. 아래는 코드 스 니펫입니다. 그것은 누구의 형식 "ST115-00001"하는 심판 번호 (결제 번호)를 계산하는 것입니다 하위 Querysave (Notesuidocument으로 소스, 변형으로 계속) 나는 DocKey의 값을 필요보기에 값을 채우는 수식
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
최종 하위
을 New_No를보기에 채 웁니다. 어떤 수식을 사용해야하며 내 논리가 맞아야합니다. 도와주세요.
감사합니다. Priya.
보기에서 열로 settlement_no 항목을 추가해야하는 것처럼 보입니까? 또는 도킹 스테이션과 new_no를보기에 원할 경우 정산 번호와 마찬가지로 문서에 저장하십시오. –