Hi,
Bit of a strange problem with my web agent. I am trying to sign the section on the form completed by the user, but it seems to be putting the name of the person who signed the agent instead!?!?
Can anyone help me out getting this working?
Code :
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim status As Integer
Dim nam As NotesName
Dim strContract As String
Dim StrItemNo As String
Dim strJobNo As String
Dim QtyChecked As String
On Error Goto errorHandling
Set db = session.CurrentDatabase
Set doc = session.DocumentContext
Set nam = session.CreateName(session.EffectiveUserName)
status = Cint(doc.status(0))
strContract = doc.ContractCode(0)
strItemNo = doc.JobItemNo(0)
strJobNo = doc.JobOrdNo(0)
If status = 0 Then
'New Doc - so set status to 5
doc.status = 5
'Since this is a new document - run the number generator to gen a number for the RIR
doc.RIRNum = NumberGenerator(strContract,strItemNo,strJobNo)
Call doc.save(True,True)
Call HTMLEmailInspector(session, db, doc)
Exit Sub
End If
If status = 5 Then
If doc.InspComplete(0) = "Yes" Then
'QA section - set status to 10
doc.status = 10
doc.InspSigned = nam.Abbreviated
doc.InspSigDate = Now
Call doc.Save(True,True)
Call HTMLEmailLeadEng(session, db, doc)
Exit Sub
Else
Exit Sub
End If
End If
If status = 10 Then
'Relase for Manufacture - set status to 15
If doc.QComplete(0) = "Yes" Then
doc.DocSigned = nam.Abbreviated
doc.DocSigDate = Now
doc.status = 15
Call doc.Save(True,True)
Exit Sub
Else
Exit Sub
End If
End If
If status = 15 And doc.RFMQComplete(0) = "Yes" Then
'Release for manufacture - stores - set status to 20
doc.status = 20
doc.RelSigned = nam.Abbreviated
doc.RelSigDate = Now
Call doc.save(True,True)
Call HTMLEmailStoreman(session, db, doc)
Call HTMLEmailTransporter(session, db, doc)
Exit Sub
End If
If status = 20 Then
'Close Off - Status 21
doc.status = 21
doc.StoreSig = nam.Abbreviated
doc.StoreSigDate = Now
doc.RIRClosed = "Yes"
doc.ClosedBy = nam.Abbreviated
doc.DateClosed = Now
Call doc.save(True,True)
Call HTMLEmailPlanning(session, db, doc)
Call HTMLEmailLeadEngInfoOnly(session, db, doc)
Exit Sub
End If
errorHandling:
Print "Workflow-RIR Error Reports:"
Print Err & " " & Error$
Print "Error Generator Failed" & Chr$(13) & Chr$(10)
Print "Doc Type: " & doc.DocType(0) & Chr$(13) & Chr$(10)
Print "RIR No: " & doc.RIRNum(0) & Chr$(13) & Chr$(10)
Print session.EffectiveUserName
Exit Sub
End Sub
Help is appreciated.
F1H