Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
share|improve this question
What error are u getting? Can you tell which line it is getting the error? – Ryan Erickson Mar 23 at 4:45

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.