Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

Bulk Approval -calling

$
0
0

Hi All,

  I am creating a scenario where the approver may approve multiple items simutaneouly. For this purpose i created a custom webpart like in image below. I am getting all the selected item IDs then running a foreach loop for each id to get xml file url. I am also getting all the file url correctly. But i dont get any response when i call the methodGetRunningWorkflowTasksForCurrentUser from web servicehttp://.../Procurement/_vti_bin/NintexWorkflow/workflow.asmx

void btn_Click(object sender, EventArgs e)
        {
            SPWeb web = SPContext.Current.Web;
            //SPUser theUser = web.CurrentUser;
            //string strUserName = theUser.LoginName;
            if(hfSelectedItems.Value.Length>1)
            {
                hfSelectedItems.Value = hfSelectedItems.Value.Substring(1);
                string[] spItenIDs = hfSelectedItems.Value.Split(',');
                foreach(string spItemId in spItenIDs)
                {
                   SPListItem item = web.Lists["Purchases"].GetItemById(Convert.ToInt32(spItemId));
                    string fileUrl = item.Web.Url+"/"+item.File.Url;
                    NintexWorkflowWS ws = new NintexWorkflowWS();
                    UserTask[] tasks = ws.GetRunningWorkflowTasksForCurrentUser(fileUrl);
                    if (tasks.Length > 0)
                    {
                        ProcessTaskResponseResult result = ws.ProcessFlexiTaskResponse2("", "Approved", tasks[0].SharePointTaskId, "Purchase Workflow Tasks");
                    }
                }
            }
        }

x


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>