Approve a SharePoint workflow task using SharePoint Web Services / Object Model

前端 未结 3 950
清酒与你
清酒与你 2020-12-30 13:53

I have created a workflow is SharePoint Designer and associated it with a list. The workflow creates an approval process, so SharePoint creates a task in the Tasks list so t

3条回答
  •  醉话见心
    2020-12-30 14:47

    You can use the following code that uses the lists web service and the UpdateListItems method. The key is to use the Cmd='Moderate'

     public static XmlNode UpdateListItemApprove()
     {
                listservice.Lists listProxy = new listservice.Lists();
    
    
                string xml = "http://basesmcdev2/sites/tester1/approvals/KL022030.lic0";
    
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xml);
    
                XmlNode batchNode = doc.SelectSingleNode("//Batch");
    
                listProxy.Url = "http://basesmcdev2/sites/tester1/_vti_bin/lists.asmx";
                listProxy.UseDefaultCredentials = true;
    
                XmlNode resultNode = listProxy.UpdateListItems("approvals", batchNode);
    
                return resultNode;
    
    
    }
    

提交回复
热议问题