If I step through the below in Visual Studio, the workflow completes fine; however, if I allow it to run naturally, it errors out. Any idea where I need to slow it down or how I would go about debugging further? Thanks. I appreciate it.
SPListItem item = workflowProperties.Item;
SPFile currFile = item.File;
// --> ProcurementManager
#region Sent
if (currFile.Item["Current Status"].ToString() == "Sent")
{
if (currFile.CheckOutType != SPFile.SPCheckOutType.None)
{
currFile.CheckIn("Received file from Vendor site.", SPCheckinType.MajorCheckIn);
}
currFile.CheckOut();
if (currFile.CheckOutType != SPFile.SPCheckOutType.None)
{
currFile.Item["Current Status"] = "ProcurementManager";
currFile.Item.Update();
currFile.CheckIn("'Sent' email sent.", SPCheckinType.MajorCheckIn);
}
return;
}
#endregion