Hi All,
Plz Any body is there to solve my problem.
I have a workflow database where in some stage iam sending the document to multiple approvers(parallel) using the following code:
- This code is written in button to call function to split approvers list and saving in another form:
If Not createApproversDocuments(uidoc) Then
Msgbox “Error in Creating Approve Documents”
Exit Sub
End If
- This code will check the approvers docs and creates
Function createApproversDocuments(cdoc As NotesUIDocument) As Boolean
On Error Goto ErrorHandler
Dim ApproversList As Variant
ApproversList = Split(cdoc.FieldGetTExt(“Approvers”), “,”)
If Not Isarray(ApproversList) Then
If Not (createSingleApproverDocument(cdoc, Cstr(ApproversList))) Then
createApproversDocument = False
Exit Function
End If
Else
For count = Lbound(ApproversList) To Ubound(ApproversList)
If Not (createSingleApproverDocument(cdoc, ApproversList(count))) Then
createApproversDocument = False
Exit Function
End If
Next
End If
'Create Approver document for Other Approvers
createApproversDocuments = True
Exit Function
ErrorHandler:
Msgbox "Error in createApproversDocument(), Line # " & Erl & ", Message : " & Error$
createApproversDocuments = False
End Function
- This code will split and create docs with status and approver name in form:
Function createSingleApproverDocument(cdoc As NotesUIDocument, ApproverName As String) As Boolean
On Error Goto ErrorHandler
Dim approverDoc As NotesDocument
Dim nam As New NotesName(ApproverName)
Set approverDoc = db.CreateDocument
approverDoc.Form = "frmApproversAction"
approverDoc.Status = "PENDING"
approverDoc.UserName = Trim(nam.Abbreviated)
approverDoc.UpdateTime = Trim(doc.ServerTime(0))
approverDoc.ParentUNID = Trim(cdoc.FieldGetText("UNID"))
approverDoc.RFCNo = Trim(doc.RFC(0))
Call approverDoc.Save(True, False)
createSingleApproverDocument = True
Exit Function
ErrorHandler:
Msgbox "Error in Line # " & Erl & ", Message : " & Error$
createSingleApproverDocument = False
End Function
Now my problem is if example one field is there and if this field value is “Yes” it should update status as approved where iam saving in the form “frmApproversAction” above mentioned for one approver(hard coded approver name) and mail should route to all approvers. Where the person(hard coded approver) will not approve this doc if that field is Yes and remaining approvers need to approve.
Above code is working fine with field value is not selected. Only problem with the field value is Yes.
How to solve my problem. Plz help me
srini