Guys,
i've created an infopath form let assume it has 2 views......
1) Requester / Submitter
2) Manager View
i've one text field in infopath form "FormStatus"
when requester submit the form to a document library, i wrote code behind on submission
public void btnSubmit_Clicked(object sender, ClickedEventArgs e)
{
string strValue = "Submitted To Manager";
string strXpath = "/my:myFields/my:FormStatus";
MainDataSource.CreateNavigator().SelectSingleNode(strXpath, NamespaceManager).SetValue(strValue);
this.Submit();
}
when user submit form, it successfully submitted to the library and i'm creating a task for the next approver (Manager) from SharePoint Designer 2013 list Workflow
on formloading event i'm checking if the logged in user is a Manager then switch to Manager View that contains two custom buttons (Approve, Reject)
i'm Approving from code behind as follows
public void btnApprove_Clicked(object sender, ClickedEventArgs e)
{
string strValue = "Approved by Manager";
string strXpath = "/my:myFields/my:FormStatus";
MainDataSource.CreateNavigator().SelectSingleNode(strXpath, NamespaceManager).SetValue(strValue);
this.Submit();
//Here i want to update this particular task Outcome to "Approved" so that my workflow moves forward. if i manually Approve Task from Workflow Task then its fine but i need to do this from code
}
when i open WorkFlow task list and perform approve reject of that task, it works fine.
but i want to update Workflow Task Outcome field to "Approved" when Manager clicks on Approve button of that particular task assigned to him, also want to update %Complete and Task Status to Completed.
Thanks