Creating an Incident Reporting System using IP/SP - InfoPath Dev
in

InfoPath Dev

Creating an Incident Reporting System using IP/SP

Last post 06-15-2009 03:49 PM by warrtalon. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 04-14-2009 12:22 PM

    Creating an Incident Reporting System using IP/SP

    Hello,

     I am trying to create an incident reporting system using an InfoPath form that submits the data in the form to a SharePoint document library. I need it to submit the data in a list view, which I have accomplished. Problem is, everytime I open the template on my computer, it overwrites the data in the SharePoint list. I need it to add another record or row, not overwrite it. I also need each record to have a unique ID (report number) which I can do through SharePoint since every form submitted has a unique ID.

     

    For Example:

    1) I open the form, fill out information, and it submits to the SharePoint Document Library in a way that each column has a record or field from the form. so that I can export into excel later (This I have been able to do).

    2) Someone else opens the form sitting somewhere, fills out information, and submits to the same library. Only instead of overwriting the existing information, it adds another row.

     

    Can you shed some light on this?

  • 04-16-2009 11:24 AM In reply to

    Re: Creating an Incident Reporting System using IP/SP

    I'm confused.  You mentioned both a library AND a list.  Do you have two separate lists, or are you just talking about one library?  If just one, then this should just be a simple forms library where you have published the form as a template to the form library, and it has a data connection for submitting the form back to that library when finished.  Then, whenever someone clicks "new," it opens a new form that makes a new record when submitted. Each time this happens, the data fields you have promoted will be populated in the library itself, which you can then use for reporting/exporting/workflows/whatever.

    I don't know how you are overwriting data unless you are putting a form in a random document library and having people open the same thing over and over.

  • 04-17-2009 09:31 AM In reply to

    Re: Creating an Incident Reporting System using IP/SP

    Disregard, I figured it out just after I posted it.

  • 04-17-2009 09:34 AM In reply to

    Re: Creating an Incident Reporting System using IP/SP

  • 04-21-2009 11:59 AM In reply to

    Re: Creating an Incident Reporting System using IP/SP

    I just published it to the sharepoint site as a web form rather than an infopath form. That took care of the problem. Now I just have to figure out how to get it to automatically create a different file name for each web form I save and close rather than me having to type in a name for the form. I don't want to overwrite existing information.

  • 04-21-2009 12:38 PM In reply to

    Re: Creating an Incident Reporting System using IP/SP

    Hmm, I'd like more details if you don't mind sharing, because we might have a red herring here.  All Infopath forms are Infopath forms.  The difference is whether or not it's browser-enabled. Even when you select this checkbox in the Form Options, it can still be opened and used as a rich client form, but it will have some features removed/restricted.  Even when this option is selected, it doesn't change the behavior in SharePoint unless you change the Advanced Setting in the forms library to default to "Open in Browser."  Only then will the form default to the browser version, and that only works if you've browser-enabled the form itself.  Regardless, this form can still be used in rich client mode by selecting "Edit in Infopath" from the pulldown menu in the library once created.

    So, what I'm getting at is that it doesn't matter if this is a browser-enabled form or not - it should work either way.  You didn't answer my initial questions, so I could only assume that you had not previously published the form as a template to a forms library.  I'm not sure what the situation was, but I can tell you how to accomplish your filename goal:

    1) Turn off the Save/Save As (Views as well) buttons in the Form Options > Browser tab.

    2) Create a data element in your form named "Filename" or whatever you prefer.  Make it a regular text field with no attributes, and don't place it on the canvas.

    3) Create a Submit-type data connection back to your forms library.  Allow overwrite if filename exists and specify the filename as the Filename data field created in step 2.

    4) Place a plain button on your canvas and change the properties accordingly:

    • Change the label to Submit (or whatever you prefer)
    • Add these Rules in this order with these conditions:
      • If Filename is not blank, then Submit to Data Connection from step 3 and Close
      • If Filename is blank, then Set Filename to Formula (create your preferred unique filename here - something like concat(userName(),"-",now())), Submit to Data Connection from step 3 and Close
    • What this does is create a unique filename automatically when submitted and closes the file cleanly with no prompts.  You could also choose not to close and leave the form open if you prefer...or have two buttons side-by-side - one that closes and one that doesn't, which is in essence a 'save' button instead of submit.  This also makes sure that any subsequent openings of this exact file get saved as the same filename each time, which means it overwrites the previous version each time it's changed.  You want this, because otherwise you get a new filename each time the file is modified...assuming files get modified after initial creation.
  • 04-21-2009 12:45 PM In reply to

    Re: Creating an Incident Reporting System using IP/SP

    Thanks for the info. Yes, my form is browser enabled. I originally had a link in a library of forms that would open the form and allow users to submit data to the library, but most of my users (100) do not have InfoPath on their PC's, so I chose to enable the web form and publish to sharepoint that way. As of a few minutes ago, I am using concat to create an incident report number based on certain fields on the form (date, time, etc) and set the incident report fields value with that and also use that fields value as the file name when I submit it to the sharepoint library when rule 2 is executed.

     

     

  • 04-21-2009 12:49 PM In reply to

    Re: Creating an Incident Reporting System using IP/SP

    Great, that's exactly how you should be using it.  Let me know if the whole setup works and if you used the instructions I mentioned.  I might make a blog post about the process, because I think it's incredibly useful - I use it for all of my forms.

  • 06-15-2009 08:45 AM In reply to

    Re: Creating an Incident Reporting System using IP/SP

    FWIW, I have created my blog and have this concept in draft form to be finished as soon as I have time.  For now, I have my first topic posted concerning pseudo User Roles for browser-enabled forms.  I mention that here, because someone did click to my blog from this thread, so I assumed it was because of my mention of blogging.

  • 06-15-2009 03:49 PM In reply to

    Re: Creating an Incident Reporting System using IP/SP

    Here is the blog post regarding the stuff explained above.  The whole post talks about more than this topic, but the there is a whole section in it that explains the custom submit button with the proper rules and conditional formatting.

    Auto-Numbering InfoPath Forms

     

Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.