Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Process_PAF (db As notesdatabase, PAF_Doc As notesdocument)
- Dim session As New NotesSession
- Dim view As notesview
- Dim PP_Doc As notesdocument
- Dim keys (1 To 2) As String
- Dim item As NotesItem
- Dim contents As String
- Dim agent As NotesAgent
- Dim server As String
- Set agent = session.CurrentAgent
- server = agent.ServerName
- Set view=db.getview("All Employees")
- keys(1)=PAF_Doc.LastName(0)
- keys(2)=PAF_Doc.FirstName(0)
- Set PP_Doc=view.getdocumentbykey(keys)
- If PP_Doc Is Nothing Then
- Messagebox "Error finding profile for " + keys(1) + ", " + keys(2),MB_OK,"Error"
- Exit Sub
- End If
- Set item = PAF_Doc.GetFirstItem( "Text" )
- contents = item.Text
- ' Replace values on Profile form
- If PAF_Doc.TermFlag(0) = "Yes" Then
- PP_Doc.ActiveInactive="Inactive"
- PP_Doc.PeopleType="Ex-internal"
- PP_Doc.EndRIADate=PAF_Doc.EffDate(0)
- PP_Doc.Status="Termination"
- End If
- If PAF_Doc.NewTitle(0)<>"" Then
- PP_Doc.JobTitleDescription=PAF_Doc.NewTitle(0)
- PP_Doc.StartTitle=PAF_Doc.EffDate(0)
- End If
- If PAF_Doc.NewTitleCode(0)<>"" Then
- PP_Doc.JobTitleCode=PAF_Doc.NewTitleCode(0)
- PP_Doc.StartTitle=PAF_Doc.EffDate(0)
- End If
- If PAF_Doc.NewAssignGroup(0)<> "" Then
- PP_Doc.AssignGroup=PAF_Doc.NewAssignGroup(0)
- End If
- If PAF_Doc.NewExempt(0)<> "" Then
- PP_Doc.Exempt=PAF_Doc.NewExempt(0)
- End If
- If PAF_Doc.NewEmpCat(0)<> "" Then
- PP_Doc.EmpCat=PAF_Doc.NewEmpCat(0)
- End If
- If PAF_Doc.NewSalGrade(0)<>"" Then
- PP_Doc.SalaryGrade=PAF_Doc.NewSalGrade(0)
- PP_Doc.LastRateChange=PAF_Doc.EffDate(0)
- End If
- If Cstr(PAF_Doc.NewAnnSal(0))<>"" Then
- PP_Doc.AnnualSalary=Cdbl(PAF_Doc.NewAnnSal(0))
- PP_Doc.Biweekly=PAF_Doc.NewBiweekly
- PP_Doc.LastRateChange=PAF_Doc.EffDate(0)
- End If
- If PAF_Doc.NewHourlyRate(0)<> "" Then
- PP_Doc.HourlyRate=PAF_Doc.NewHourlyRate(0)
- PP_Doc.LastRateChange=PAF_Doc.EffDate(0)
- End If
- If Cstr(PAF_Doc.NewAwardAmount(0))<> "" Then
- PP_Doc.AwardAmount=PAF_Doc.NewAwardAmount(0)
- End If
- If PAF_Doc.NewSalaryBasis(0)<> "" Then
- PP_Doc.SalaryBasis=PAF_Doc.NewSalaryBasis(0)
- End If
- If PAF_Doc.NewEarnElement(0)<> "" Then
- PP_Doc.EarnElement=PAF_Doc.NewEarnElement(0)
- End If
- If PAF_Doc.NewStatus(0)<> "" Then
- PP_Doc.Status=PAF_Doc.NewStatus(0)
- End If
- If PAF_Doc.NewAddress(0)<>"" Then
- PP_Doc.Address=PAF_Doc.NewAddress(0)
- End If
- If PAF_Doc.NewCity(0)<>"" Then
- PP_Doc.City=PAF_Doc.NewCity(0)
- End If
- If PAF_Doc.NewState(0)<>"" Then
- PP_Doc.State=PAF_Doc.NewState(0)
- End If
- If PAF_Doc.NewZip(0)<>"" Then
- PP_Doc.Zip=PAF_Doc.NewZip(0)
- End If
- If PAF_Doc.NewHomePhone(0)<>"" Then
- PP_Doc.HomePhone=PAF_Doc.NewHomePhone(0)
- End If
- If PAF_Doc.NewLN(0)<>"" Then
- PP_Doc.LastName=PAF_Doc.NewLN(0)
- End If
- If PAF_Doc.NewFN(0)<>"" Then
- PP_Doc.FirstName=PAF_Doc.NewFN(0)
- End If
- If PAF_Doc.A1(0) = "Yes" Then
- PP_Doc.fd1 = ""
- If PAF_Doc.AccountSel(0) = "Yes" Then
- PP_Doc.Account1 = PAF_Doc.NewAcc1(0)
- PP_Doc.Project1 = PAF_Doc.Project_1(0)
- PP_Doc.Task1 = PAF_Doc.Task_1(0)
- PP_Doc.Award1 = PAF_Doc.Award_1(0)
- PP_Doc.EXP_1 = PAF_Doc.NewEXP_1(0)
- PP_Doc.td1 = PAF_Doc.NewTerm1(0)
- PP_Doc.Actual1 = PAF_Doc.NewActual1(0)
- PP_Doc.Effort1 = PAF_Doc.NewEff1(0)
- PP_Doc.FTE = PAF_Doc.NewFTE(0)
- If PAF_Doc.NewAcc1(0) <> "" Then
- PP_Doc.fd1=PAF_Doc.EffDate(0)
- End If
- End If
- End If
- If PAF_Doc.A2(0) = "Yes" Then
- PP_Doc.fd2 = ""
- If PAF_Doc.AccountSel(0) = "Yes" Then
- PP_Doc.Account2 = PAF_Doc.NewAcc2(0)
- PP_Doc.Project2 = PAF_Doc.Project_2(0)
- PP_Doc.Task2 = PAF_Doc.Task_2(0)
- PP_Doc.Award2 = PAF_Doc.Award_2(0)
- PP_Doc.EXP_2 = PAF_Doc.NewEXP_2(0)
- PP_Doc.td2 = PAF_Doc.NewTerm2(0)
- PP_Doc.Actual2 = PAF_Doc.NewActual2(0)
- PP_Doc.Effort2 = PAF_Doc.NewEff2(0)
- If PAF_Doc.NewAcc2(0) <> "" Then
- PP_Doc.fd2=PAF_Doc.EffDate(0)
- End If
- End If
- End If
- If PAF_Doc.A3(0) = "Yes" Then
- PP_Doc.fd3 = ""
- If PAF_Doc.AccountSel(0) = "Yes" Then
- PP_Doc.Account3 = PAF_Doc.NewAcc3(0)
- PP_Doc.Project3 = PAF_Doc.Project_3(0)
- PP_Doc.Task3 = PAF_Doc.Task_3(0)
- PP_Doc.Award3 = PAF_Doc.Award_3(0)
- PP_Doc.EXP_3 = PAF_Doc.NewEXP_3(0)
- PP_Doc.td3 = PAF_Doc.NewTerm3(0)
- PP_Doc.Actual3 = PAF_Doc.NewActual3(0)
- PP_Doc.Effort3 = PAF_Doc.NewEff3(0)
- If PAF_Doc.NewAcc3(0) <> "" Then
- PP_Doc.fd3=PAF_Doc.EffDate(0)
- End If
- End If
- End If
- If PAF_Doc.A4(0) = "Yes" Then
- PP_Doc.fd4 = ""
- If PAF_Doc.AccountSel(0) = "Yes" Then
- PP_Doc.Account4 = PAF_Doc.NewAcc4(0)
- PP_Doc.Project4 = PAF_Doc.Project_4(0)
- PP_Doc.Task4 = PAF_Doc.Task_4(0)
- PP_Doc.Award4 = PAF_Doc.Award_4(0)
- PP_Doc.EXP_4 = PAF_Doc.NewEXP_4(0)
- PP_Doc.td4 = PAF_Doc.NewTerm4(0)
- PP_Doc.Actual4 = PAF_Doc.NewActual4(0)
- PP_Doc.Effort4 = PAF_Doc.NewEff4(0)
- If PAF_Doc.NewAcc4(0) <> "" Then
- PP_Doc.fd4=PAF_Doc.EffDate(0)
- End If
- End If
- End If
- PP_Doc.ECFHistory=PP_Doc.ECFHistory(0) + Chr(10) + Cstr(PAF_Doc.EffDate(0)) + ": " + PAF_Doc.Reason_disp(0) + "; " + contents
- Call PP_Doc.Save(False,True)
- PAF_Doc.PafStatus="Complete" 'Change status of PAF to "Complete" and save
- PAF_Doc.LastEditor=server + " (" + agent.name + ")" 'Records server & agent name as LastEditor on paf4 (ECF)
- PP_Doc.LastEditor=server + " (" + agent.name + ")" 'Records current server & agent name as LastEditor on Personnel Profile
- PP_Doc.ModifiedDate=Now 'Records date & time in ModifiedDate field on Personnel Profile
- Call PAF_Doc.Save(False,True)
- Call PAF_Doc.Save(False,True)
- Call PP_Doc.Save(False,True)
- Call PP_Doc.Save(False,True)
- End Sub
Add Comment
Please, Sign In to add comment