Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Initialize
- On Error Goto Errhandle
- ' 轉銷假單,表單開啟時要抓取請假單上表單對應資訊
- ' used by FrmCancelEditLeave
- 'Msgbox "轉銷假單,表單開啟時要抓取請假單上表單對應資"
- Dim s As New NotesSession
- Set Newdoc=s.Documentcontext
- Dim db1 As NotesDatabase
- Set db1=s.CurrentDatabase
- Dim ldview As NotesView
- Set ldview=db1.GetView("ldno")
- Newdoc.docno0=Strright(newdoc.query_string_decoded(0),"docid=")
- Msgbox newdoc.query_string_decoded(0)
- key = Newdoc.docno0(0)
- ' Newdoc.ApplyEmpNo="XXXX"
- ' Msgbox newdoc.docno0(0)
- If key <> "" Then
- Set Maindoc=ldview.GetDocumentByKey(key,True)
- If Not Maindoc Is Nothing Then
- Call Newdoc.ReplaceItemValue("ApplyEmpNo", Maindoc.ApplyEmpNo(0))
- Call Newdoc.ReplaceItemValue("EName", Maindoc.EName(0))
- Call Newdoc.ReplaceItemValue("ApplyCName", Maindoc.ApplyCName(0))
- Call Newdoc.ReplaceItemValue("ApplyDept", Maindoc.ApplyDept(0))
- Call Newdoc.ReplaceItemValue("ApplyDeptNo", Maindoc.ApplyDeptNo(0))
- Call Newdoc.ReplaceItemValue("ApplyDeptNo0", Maindoc.ApplyDeptNo0(0))
- Call Newdoc.ReplaceItemValue("ApplyTitle", Maindoc.ApplyTitle(0))
- Call Newdoc.ReplaceItemValue("ApplyLocation", Maindoc.ApplyLocation(0))
- Call Newdoc.ReplaceItemValue("ApplyNotesID", Maindoc.ApplyNotesID(0))
- Call Newdoc.ReplaceItemValue("ApplyManagerID", Maindoc.ApplyManagerID(0))
- Call Newdoc.ReplaceItemValue("VacationTypeList", Maindoc.VacationTypeList(0))
- Call Newdoc.ReplaceItemValue("ApplyDirectManagerName", Maindoc.ApplyDirectManagerName(0))
- Call Newdoc.ReplaceItemValue("LeaveType", Maindoc.LeaveType(0))
- Call Newdoc.ReplaceItemValue("oFormMemo", Maindoc.FormMemo(0))
- Call Newdoc.ReplaceItemValue("datStart", Maindoc.datStart(0))
- Call Newdoc.ReplaceItemValue("datEnd", Maindoc.datEnd(0))
- Call Newdoc.ReplaceItemValue("FromTimeS", Maindoc.FromTimeS(0))
- Call Newdoc.ReplaceItemValue("ToTimeE", Maindoc.ToTimeE(0))
- Call Newdoc.ReplaceItemValue("TotalDays", Maindoc.TotalDays(0))
- Call Newdoc.ReplaceItemValue("TotalHour", Maindoc.TotalHour(0))
- Call Newdoc.ReplaceItemValue("Leavedays", Maindoc.leavedays(0))
- Call Newdoc.ReplaceItemValue("RECORDDATE", Maindoc.RECORDDATE)
- Call Newdoc.ReplaceItemValue("RECORDDATE1", Maindoc.RECORDDATE1)
- Call Newdoc.ReplaceItemValue("RECORDDATE2", Maindoc.RECORDDATE2)
- Call Newdoc.ReplaceItemValue("C1WORKHOURS", Maindoc.C1WORKHOURS(0))
- Call Newdoc.ReplaceItemValue("C2WORKHOURS", Maindoc.C2WORKHOURS(0))
- Call Newdoc.ReplaceItemValue("C1HOURS", Maindoc.C1HOURS(0))
- Call Newdoc.ReplaceItemValue("C2HOURS", Maindoc.C2HOURS(0))
- Call Newdoc.ReplaceItemValue("applyemptype", Maindoc.applyemptype(0))
- Call Newdoc.ReplaceItemValue("ApplyDeptReaders", Maindoc.ApplyDeptReaders)
- Call Newdoc.ReplaceItemValue("ApplyCName1", Maindoc.ApplyCName1(0))
- Call Newdoc.ReplaceItemValue("ApplyEmpNo1", Maindoc.ApplyEmpNo1(0))
- Call Newdoc.ReplaceItemValue("ApplyTitle1", Maindoc.ApplyTitle1(0))
- Call Newdoc.ReplaceItemValue("ApplyDept1", Maindoc.ApplyDept1(0))
- Call Newdoc.ReplaceItemValue("ApplyDeptNo1", Maindoc.ApplyDeptNo1(0))
- Call NewDoc.computewithform(False, False)
- End If
- End If
- Terminate:
- Exit Sub
- Errhandle:
- Msgbox Cstr(Erl) & " (WebCancelGetValue" & Error() & ")", 16,"Error in customer code"
- Resume Terminate
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement