Hi All,
Currently am facing with following issue.
Our client have SharePoint 2013 production environment.
We have build our custom SharePoint Designer Approval workflow and published it to InfoPath forms library.
The workflow has 4 approval level with multiple approver involved in each stage as follows.
1) Departmental Manager Approval
2) HR Head approval
3) IT Head Approval
4) IT Admin Approval
Issue comes here ,
=> When HR Head Approves the item, the Approval task gets created for IT admin.
=> When It Admin try to approve or reject it gives error message
"This task is currently locked by a running workflow and cannot be edited".
I tried to solve the issue with following powershell script but no luck.
$siteUrl="https://.../WorkflowTasks"
$site = new-object Microsoft.SharePoint.SPSite($siteUrl)
$web=$site.OpenWeb()
$web.url
$i=0
write-host $web.lists
foreach($list in $web.lists){
foreach($item in $list.items | where {$_[[Microsoft.SharePoint.SPBuiltInFieldId]::WorkFlowVersion] -ne 1}){
if($item["Status"] -eq "Not Started" -and $item["ID"] -eq "1602")
{
Try
{
Write-Host Unlocking workflow on $item.name
$item[[Microsoft.SharePoint.SPBuiltInFieldId]::WorkFlowVersion]=1;
$item.SystemUpdate()
$i++
}
Catch [System.Exception]
{
Write-Host Caught error trying to unlock workflow -ForegroundColor Red
}
}
}
}
Write-Host Unlocked $i workflows within $web.url
$web.dispose()
$site.dispose()
Anybody can help me to guide what could be the reason behind this issue.
And what is the right way to solve this issue.
Any help would be more than welcome.
Awaiting...
Thank you.