Answered by:
Sandboxed WorkflowCompleted event receivers

Question
-
Hi.
I need to develop the event receivers for 2010 server sandboxed solution. I added event receiver to my sandboxed project, attached it to libraries based on 101 template <Receivers ListTemplateId="101">. I left only default code in receivers
public override void WorkflowCompleted(SPWorkflowEventProperties properties) { base.WorkflowCompleted(properties); }
but the breakpoint on it doesn't fire. I attached debugger to all sandboxed worker processes, owstimer manually, it didn't help.
I looked at associated event receivers of the library in SharePoint Manager - everything is OK, they're attached to the library.
Then I tried another sandboxed event reciever - itemupdated/itemupdating - everything fired and worked fine. Also I tried to make the WF event receiver as a farm solution - it began to work. But I need only sandboxed solution.
Is it possible to make sandboxed solution with workflowcompleted event reciever?
Regards, Yulia.
Monday, August 26, 2013 12:29 PM
Answers
-
Thanks for your replies.
I made some research and found how to solve my business problem. Problem to handle workflow completed event. I can't handle WorkflowCompleted event. By I can handle IetmAdded event for Workflow History List (Template=140). So I handle this event, check fields of workflow history item to find if workflow is completed and instance id of the workflow. Maybe it's not a good and universal way. But it works in sandbox.
- Proposed as answer by Aries - MSFT Friday, August 30, 2013 10:18 AM
- Marked as answer by Qiao Wei Monday, September 2, 2013 12:43 AM
Friday, August 30, 2013 10:16 AM
All replies
-
Hi Yulia,
I can reproduce your issue, that the WorkflowCompleted event isn’t fired using Sandbox solution.
The method shows available for Sandbox solution, I will involve someone familiar with this topic to further look at this, thanks for your understanding.
Thanks,
Qiao Wei
TechNet Community SupportWednesday, August 28, 2013 8:09 AM -
Hi Yulia,
as i tried, i got the same results as qiao,
as i checked on:
http://msdn.microsoft.com/en-us/library/ff872402.aspx
http://sharepointx-men.com/2010/07/09/sharepoint-2010-event-receivers-part-1-create-event-receiver-for-content-types/
http://sharepointx-men.com/2010/07/09/sharepoint-2010-event-receivers-part-2-create-event-receiver-for-content-types/i checked in some of the articles and found out:
http://msdn.microsoft.com/en-us/library/gg981880(v=office.14).aspx
for workflowcompleted that joined with sandbox seems need some adjustments, you may check on the point Example 5: Logging Events
i found another article about thie workflowcompleted event, perhaps you may take a look:
http://blog.symprogress.com/2011/09/sp-2010-get-workflow-status-workflowcompleted-event/Regards,
Aries
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.Wednesday, August 28, 2013 10:22 AM -
You should attach your w3wp process to SPUCWorkerProcess.exe to debug your code.
All the code in Sandbox solution run under SPUCWorkerProcess process.
#RoHsTr
Wednesday, August 28, 2013 10:55 AM -
Thanks for your replies.
I made some research and found how to solve my business problem. Problem to handle workflow completed event. I can't handle WorkflowCompleted event. By I can handle IetmAdded event for Workflow History List (Template=140). So I handle this event, check fields of workflow history item to find if workflow is completed and instance id of the workflow. Maybe it's not a good and universal way. But it works in sandbox.
- Proposed as answer by Aries - MSFT Friday, August 30, 2013 10:18 AM
- Marked as answer by Qiao Wei Monday, September 2, 2013 12:43 AM
Friday, August 30, 2013 10:16 AM