eventssharepoint-2010infopatheventreceiver

Sharepoint ItemAdding & ItemAdded issue


I need to retrieve an Infopath File, which is displayed and filled in on a sharepoint webpage, and save it's data to a seperate DB. There are 2 events that fire once the form is submitted. ItemAdding and ItemAdded.

I know that I can not retrieve the file from the ItemAdding Event because it only gets saved after the ItemAdding Event.

But I want to redirect users to a different website once I have stored my values to the database, but I find no way to do this. I guess, the problem is that the ItemAdded event occurs, after/or at the same time as the user gets redirected to the webpage showing "The form has been closed".

How can I retrieve the values and redirect the user? Also, I am not allowed to attach code to the infopath form itself. This needs to be handled from Sharepoint.

Thank you


Solution

  • If you are redirecting within the SharePoint site you can include "source" as a query string parameter.

    You also try a response.redirect in the OnClose event of the infopath form.