I have a weird issue with a custom SharePoint Visual Studio workflow written in c#, where one of the approval steps will not move on to the next step in the workflow after the approval. I have done a lot of debugging and have tied it down to a missing task status field in the extendedproperties of the afterproperties of the workflow step.
This property is checked for a null value in a common method that multiple workflows use:
if (AfterProperties.ExtendedProperties.ContainsKey(TaskStatusFieldId))
After it hits this line of code, it does not find the TaskStatusFieldId key in the after properties and then skips the rest of the method. This causes the step to not update the percent complete, so it says "Approved", but it never goes to the next step.
The task status field is a SharePoint field that is looked up with the following guid:
publicstaticGuid TaskStatusFieldId =newGuid("c15b34c3-ce7d-490a-b133-3f4de8801b76");
The weird issue is that this issue seems to be random. The same approver can approve the task and it will work one time and not the next. Sometimes I can get through all the approval steps and the next time it will fail in the first or second
task. I haven't been able to find any consistency with reproducing this error. I tried disabling the Microsoft SharePoint Foundation Workflow Timer Service on all but one servers to check if it was a load balancing issue, but had no luck.
Any help would be greatly appreciated.
Thank you!