locked
Save items in InfoPath to SQL RRS feed

  • Question

  • I am starting to get the hang of development of InfoPath and using code behind for various activites.

    I have constructed a SQL WebService using Linq for development of a Browser Enabled InfoPath Form that saves and records items to SQL as well as SharePoint.

    I am thinking about taking this in a new direction and I am curious if anyone has tackled something like this.

    Rather than saving the form initially to SQL and then working approvals and comments....

    I was thinking, I'd have a user populate the form as a whole....  When the form was final and fully approved, then take the contents of the form and write them to a SQL Server DB.

    Has anyone read a post about something like this?  Extracting the fields form an InfoPath form (to include several repeating tables) and saving them to a SQL Backend based on a trigger?

     

    Tuesday, June 7, 2011 3:46 PM

All replies

  • Hi Cory,

    Yes I have done this.  I do all the routing before anything hits the DB because what if it gets rejected and shouldn't be in the DB?  I'm not familar with Linq.  Is this a browser-enabled form or filler form?

    How are they currently submitting the form?  Is it the built in submit on the InfoPath toolbar?  I strictly use buttons so that each button submits differently conditionally on what stage the form is and who the user is.

    Tuesday, June 7, 2011 5:47 PM
  • Thanks for the reply!  And yes, your thinking is right along with mine.  Not only if the request was rejected, but if it was changed as well - easier to keep everything out of SQL until it is finalized.

    Anyways...

    Right now I built a Browser Enabled form to replace a previous version someone had made which was not.

    I built the form as a Web Service form and attached it to my SQL Server via Web Service as the Primary Data Source.
    I added the SharePoint list as a Secondary Source.

    Currently when the form is initially submitted, it is saved in whole in SQL and Sharepoint only reports the various columns I need to kick off workflows.

    I was thinking, it might be handy to save the form to SharePoint and write to SQL after the fact.

    I do not use the toolbar for these operations, only the submit button.

    Right now I am battling user roles....

    As a user can have multiple roles depending on the department submitting the form.
    Bit complex, but I am working it out.
    I am also considering to skip SharePoint as my workflow tracker and simply do all the workflow on the form itself.
    Send emails using C#  (I finally got my head around XPathNavigator)....

    Linq is an addon to Visual Studio which builds all the classes for your database simply by dragging tables over and building the relationships.

    Makes quick work of a database webservice.

     

    Tuesday, June 7, 2011 5:57 PM