Basic Rundown of Process: I am creating a Process wherein an InfoPath form is Submitted to a Library, certain managers will then have the ability to change a drop-down to either Approved or Rejected, and emails will be sent out appropriately. Users must be able to Add new forms and resubmit old forms with modifications, but not edit and re-save an existing form, regardless of its approved or rejected state.
Current Situation: Proof of Concept library and form are created and functional, and an appropriately designed workflow is created to run off of the ItemUpdating Event Receiver. Managers have Contribute or above, the Test User has Contribute. When added, the Event Receiver will properly redirect users to a nice error page if they try to edit the drop-down, and managers are able to take any action as expected. Users however cannot add new forms or resubmit existing ones.
Note that errors are cause when a user Clicks on an existing form or a the Add a new form and then attempts to submit the form, and receives
A Microsoft SharePoint Server State Service error occurred while processing your request. For more information, contact your server farm administrator.
Errors in Logs on User Attempts:
StateSqlSession.GetItemBytesInternal() Locked row in database for key (Guid1)_(Guid2) for x seconds
and then
StateManager.GetState() Locked data (Guid2)
Note that the Guids do not refer to the Web, Library, Library Items, or anything else i can see
Code:
public override void ItemUpdating(SPItemEventProperties properties)
{
base.ItemUpdating(properties);
if (properties.UserLoginName != @"Domain\Manager1" && properties.UserLoginName != @"Domain\Manager2" && ...)
{
properties.Cancel = true;
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl;
properties.RedirectUrl = "/SitePages/TestErrorRedirect.aspx";
}
else if ( /* Item has an Approval Value */ )
{
// Send email based Approve/Reject state and only if state has changed
}
}
All references I find online to similar errors are due to SQL calls or in one case a file that's too big, but nothing related to this.