Setting ModerationInformation.Status from Approved back to pending removes

Posted by Gavin Morgan on Stack Overflow See other posts from Stack Overflow or by Gavin Morgan
Published on 2009-11-02T11:33:09Z Indexed on 2010/04/09 23:03 UTC
Read the original article Hit count: 326

Seeing if anyone else has had this problem and a resolution to it.

I have a visual studio sequential workflow on a list (not a library) which does NOT use tasks, the approval process is done through the Approve/Reject OOTB buttons on the list item. The approval is a 2 stage approval, whereby if the 1st stage is completed (via clicking the Approve OOTB button), i reset the ModerationInformation.Status from Approved back to pending then send an email to the 2nd stage approver.

My problem is, when i set the the ModerationInformation.Status back to Pending from Approved so there is never an approved version, the Creator loses permissions to view the item, and i get the "cannot find item" error from SharePoint for the person who created the item. The 1st and 2nd level approvers and anyone with approve rights CAN still see the item.

Some more background information. the code i am using to update the moderationinformation is

I get the properties from the workflow event and get a hook into the listitem

properties.Item.ModerationInformation.Status = SPModerationStatusType.Pending; properties.Item.Update();

can anyone help.

© Stack Overflow or respective owner

Related posts about sharepoint

Related posts about sequential-workflow