Advertisement
imjyb1008work

WebCancelGetValue

Jun 12th, 2014
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Initialize
  2.    
  3.     On Error Goto Errhandle
  4.     ' 轉銷假單,表單開啟時要抓取請假單上表單對應資訊
  5.     ' used by FrmCancelEditLeave
  6.     'Msgbox "轉銷假單,表單開啟時要抓取請假單上表單對應資"
  7.     Dim s As New NotesSession  
  8.     Set Newdoc=s.Documentcontext
  9.    
  10.     Dim db1 As NotesDatabase
  11.     Set db1=s.CurrentDatabase
  12.    
  13.     Dim ldview As NotesView
  14.    
  15.     Set ldview=db1.GetView("ldno")
  16.    
  17.     Newdoc.docno0=Strright(newdoc.query_string_decoded(0),"docid=")
  18.    
  19.     Msgbox newdoc.query_string_decoded(0)
  20.     key = Newdoc.docno0(0)
  21. '   Newdoc.ApplyEmpNo="XXXX"
  22. '   Msgbox newdoc.docno0(0)
  23.     If key <> "" Then      
  24.         Set Maindoc=ldview.GetDocumentByKey(key,True)
  25.        
  26.         If Not Maindoc Is Nothing Then         
  27.            
  28.             Call Newdoc.ReplaceItemValue("ApplyEmpNo", Maindoc.ApplyEmpNo(0))
  29.             Call Newdoc.ReplaceItemValue("EName", Maindoc.EName(0))
  30.            
  31.             Call Newdoc.ReplaceItemValue("ApplyCName", Maindoc.ApplyCName(0))          
  32.             Call Newdoc.ReplaceItemValue("ApplyDept", Maindoc.ApplyDept(0))
  33.             Call Newdoc.ReplaceItemValue("ApplyDeptNo", Maindoc.ApplyDeptNo(0))
  34.             Call Newdoc.ReplaceItemValue("ApplyDeptNo0", Maindoc.ApplyDeptNo0(0))
  35.             Call Newdoc.ReplaceItemValue("ApplyTitle", Maindoc.ApplyTitle(0))
  36.             Call Newdoc.ReplaceItemValue("ApplyLocation", Maindoc.ApplyLocation(0))
  37.             Call Newdoc.ReplaceItemValue("ApplyNotesID", Maindoc.ApplyNotesID(0))
  38.             Call Newdoc.ReplaceItemValue("ApplyManagerID", Maindoc.ApplyManagerID(0))
  39.             Call Newdoc.ReplaceItemValue("VacationTypeList", Maindoc.VacationTypeList(0))
  40.             Call Newdoc.ReplaceItemValue("ApplyDirectManagerName", Maindoc.ApplyDirectManagerName(0))
  41.             Call Newdoc.ReplaceItemValue("LeaveType", Maindoc.LeaveType(0))
  42.             Call Newdoc.ReplaceItemValue("oFormMemo", Maindoc.FormMemo(0))
  43.            
  44.            
  45.             Call Newdoc.ReplaceItemValue("datStart", Maindoc.datStart(0))
  46.             Call Newdoc.ReplaceItemValue("datEnd", Maindoc.datEnd(0))
  47.             Call Newdoc.ReplaceItemValue("FromTimeS", Maindoc.FromTimeS(0))
  48.             Call Newdoc.ReplaceItemValue("ToTimeE", Maindoc.ToTimeE(0))
  49.             Call Newdoc.ReplaceItemValue("TotalDays", Maindoc.TotalDays(0))
  50.             Call Newdoc.ReplaceItemValue("TotalHour", Maindoc.TotalHour(0))
  51.             Call Newdoc.ReplaceItemValue("Leavedays", Maindoc.leavedays(0))
  52.             Call Newdoc.ReplaceItemValue("RECORDDATE", Maindoc.RECORDDATE)
  53.             Call Newdoc.ReplaceItemValue("RECORDDATE1", Maindoc.RECORDDATE1)
  54.             Call Newdoc.ReplaceItemValue("RECORDDATE2", Maindoc.RECORDDATE2)
  55.             Call Newdoc.ReplaceItemValue("C1WORKHOURS", Maindoc.C1WORKHOURS(0))
  56.             Call Newdoc.ReplaceItemValue("C2WORKHOURS", Maindoc.C2WORKHOURS(0))
  57.             Call Newdoc.ReplaceItemValue("C1HOURS", Maindoc.C1HOURS(0))
  58.             Call Newdoc.ReplaceItemValue("C2HOURS", Maindoc.C2HOURS(0))
  59.            
  60.             Call Newdoc.ReplaceItemValue("applyemptype", Maindoc.applyemptype(0))
  61.             Call Newdoc.ReplaceItemValue("ApplyDeptReaders", Maindoc.ApplyDeptReaders)
  62.            
  63.             Call Newdoc.ReplaceItemValue("ApplyCName1", Maindoc.ApplyCName1(0))
  64.             Call Newdoc.ReplaceItemValue("ApplyEmpNo1", Maindoc.ApplyEmpNo1(0))
  65.             Call Newdoc.ReplaceItemValue("ApplyTitle1", Maindoc.ApplyTitle1(0))
  66.             Call Newdoc.ReplaceItemValue("ApplyDept1", Maindoc.ApplyDept1(0))
  67.             Call Newdoc.ReplaceItemValue("ApplyDeptNo1", Maindoc.ApplyDeptNo1(0))
  68.            
  69.             Call NewDoc.computewithform(False, False)          
  70.         End If     
  71.     End If
  72.    
  73. Terminate:
  74.     Exit Sub
  75. Errhandle:
  76.     Msgbox Cstr(Erl) & " (WebCancelGetValue" & Error() & ")", 16,"Error in customer code"
  77.     Resume Terminate
  78. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement