Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to create event receiver or workflow on SharePoint-hosted apps in SharePoint 2013? I have not much knowledge about SharePoint apps. If yes then how to create it...

Can we use Remote Event Receiver in SharePoint hosted apps?

share|improve this question
    
have you try same way which developed in SP2010? –  Jigs Jan 16 '13 at 5:29
    
Hi @Jigs. Thanks for your reply. But How can i deploy event receiver on my custom SharePoint-hosted app? What can i add siteURL in Project Properties? Can i use List which is added in SharePoint-hosted apps? –  Viraj Gorajia Jan 16 '13 at 5:45
1  
yes.you can.if you used custom list template than associate template ID on your Event Receiver's Element file like <Receivers ListTemplateId="TemplateID"> –  Jigs Jan 16 '13 at 5:53
    
@Jigs I have created one task list in SharePoint-hosted apps. So TemplateID is that <Receivers ListTemplateId="171">.. But Event is not fired on Item Added in Tasks list. –  Viraj Gorajia Jan 16 '13 at 6:27

1 Answer 1

up vote 2 down vote accepted

When you attempt to add a Remote Event Receiver to a SharePoint-hosted app project, Visual Studio will add a new web application project to the solution that includes a remote event receiver WCF service. Because a remote event receiver relies on a WCF endpoint to "remotely" handle the events being raised from SharePoint, and this WCF endpoint contains server-side code, by definition it cannot run in a SharePoint-hosted app. For more information, see this remote event receiver how-to on MSDN.

You can, however, create and deploy simple workflows within SharePoint-hosted apps. You can read more about workflow-powered apps for SharePoint here. In general, you should only use workflow in a SharePoint-hosted app when the workflow is integral to the app for SharePoint itself, as the workflow will only be operating on lists within the app web. (Note that in order to successfully build my SharePoint-hosted app project using the Microsoft Office Developer Tools for Visual Studio 2012 - Preview 2, I had to add references to System.Web 4.0.0.0 and System.Drawing 4.0.0.0.)

share|improve this answer
    
Hello @Danny Jessee, I have tried workflow on SharePoint hosted apps, but it gives error.. So Workflow manager tool is required for creating workflow on SharePoint hosted apps? –  Viraj Gorajia Jan 21 '13 at 4:32
    
What is the error you are getting? I do have Workflow Manager 1.0 installed and configured in my environment per this article: blog.cloudshare.com/2013/01/15/… –  Danny Jessee Jan 21 '13 at 12:57
    
Ya @Danny Jessee, In workflow manager installation process,it download some files and i have no permission to access internet... But thanks for your reply and i will try. –  Viraj Gorajia Jan 22 '13 at 4:26

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.