HI,
I'd like to call the Nintex-WebService from Powershell to delegate a task.
I'm using my script as shown:
$web = Get-SPWeb "http://myWeb" $list = $web.Lists["DelegateTasks"] $myItem = $list.GetItemById(1) $username = "administrator" $password = "secretWord" $domain = "domain" $taskID = $myItem["Title"] $taskList = $myItem["ListId"] $taskDelegateeSPUser = $myItem["Delegatee"] $taskDelegateUserObject = $userObj = New-Object Microsoft.SharePoint.SPFieldUserValue($web, $taskDelegateeSPUser) $taskDelegatee = $taskDelegateUserObject.User.UserLogin if($taskDelegatee.ToString().Contains("|")) { $taskDelegatee = $taskDelegatee.ToString().Split("|")[1] } $taskDelegationComment = $myItem["Comment"] $taskNotifyFlag = $false $wsUrl = $web.Url + "/_vti_bin/NintexWorkflow/Workflow.asmx?WSDL" $proxy = New-WebServiceProxy -Uri $wsUrl $proxy.Credentials = new-object System.Net.NetworkCredential($username, $password, $domain) [xml]$response = $proxy.DelegateTask($taskID, $taskList, $taskDelegatee, $taskDelegationComment, $taskNotifyFlag.ToString()) $web.Dispose()
Now I always get: "this task is currently locked by a running workflow and cannot be edited"
What can I do? Where is my error?
Kind regards,
Markus