How to save form without submitting in InfoPath form services - InfoPath Dev
in

InfoPath Dev

How to save form without submitting in InfoPath form services

Last post 12-02-2014 08:54 AM by tiffyh. 27 replies.
Page 1 of 2 (28 items) 1 2 Next >
Sort Posts: Previous Next
  • 02-17-2010 04:59 PM

    How to save form without submitting in InfoPath form services

    Hi,

    I have two types form libraries, one to house forms to be filled and the other type is for filled forms.  Eg. Forms is of first type and Travel Requests, Purchase Orders etc are of second type. I have published my forms in "Forms" library and when they are filled, they are saved in their respective libraries, hope I am clear.

    When forms from "Form" library is opened it only has "Submit", "Close", and "Print Privew" options. Couple of my forms are long and now users wants to be able to save forms without submitting so that they can work on the forms later.

    How can I get this this funtionality? Any help/suggestion/direction is appreciated.

    Thanks,

    Tyampoo
  • 02-17-2010 05:19 PM In reply to

    • SimonHall72
    • Not Ranked
    • Joined on 02-05-2010
    • Brisbane, Australia
    • Posts 4

    Re: How to save form without submitting in InfoPath form services

    Setting the “submit” location for InfoPath forms is easy enough. But unless we disable the “save” button, users can save the form as well. And being able to save a form before it is submitted is a good idea.

    Unfortunately, the default save location is where the form is opened from. But we can alter this location in the javascript that launches the form.

    You need to create some custom links that launch forms. These links call the createNewDocumentWithRedirect function. This function is called by SharePoint itself when you click the “New” button. I’ve abstracted the function so that it can be used on any site and only need to pass in the relative site path and InfoPath template we’re calling. This code can go into a content editor webpart.

    Of particular interest below is the strSaveLocation variable. Setting this to 'C:\\Documents and Settings\\All Users \\Desktop' will save the form on the users desktop rather than the form library, but will still allow it to be submitted to the form library.

    The site parameter is the relative url of the site, e.g. sites/mmr. The template parameter is the name that the form is published under. In the below case it is the Breaches and Incidents Notices form.

    <script type="text/javascript">
          function newForm(site, template){
                var url = 'http://' + window.location.hostname + '/' + site + '/';
                var template = url + template + '/Forms/template.xsn';
                var saveLocation = 'C:\\Documents and Settings\\All Users\\Desktop';
                var progID = 'SharePoint.OpenXmlDocuments.2';
                var bXMLForm = true;
                var redirectUrl = url + '_layouts/FormServer.aspx?XsnLocation=' + window.location;
                var defaultItemOpen = 0;
     
                createNewDocumentWithRedirect(template, saveLocation, progID, bXMLForm, redirectUrl, defaultItemOpen);
          }
      </script>
    <P><A onclick="newForm('sites/mmr', 'BreachesAndIncidentsNotices')" href="#">Please click here to create and submit
     a new Breach and Incident Notice.</A>
    
  • 02-17-2010 08:55 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    if you are using managed code, and your form is not browser enabled.

    this.save();

    should do the work of saving the form.

     

    Qazi Anis
    Technical Architect
    Bitwise Inc
    Filed under:
  • 02-18-2010 12:33 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    Thanks for the reply,

     What I have is the SharePoint Designer, where and how would I make the change?

    Thanks again,

    Tyampoo
  • 02-18-2010 09:27 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    why dont you just enable the save options, to do so

    open your form template

    goto -> tools -> form options -> open and save and check the Save and Save as check box,

    publish the form

    now save option should be available to the user

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 02-19-2010 11:29 AM In reply to

    Re: How to save form without submitting in InfoPath form services

    Thanks Qazi for the reply,

     I have everything checked in Form Options > Browser and in 'Open and Save'. As I said, form templates are published in one form library while submitted forms in different library and what i need is to save a (partially) filled library (somewhere) without submitting it.

    I assumed, the workflow is only triggred when the form is submitted and the workflow will not be triggered if just saved (which I am trying to do). Am I correct?

    Thanks again,

    Tyampoo
  • 02-24-2010 04:44 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    This is what I trying to do:

    1. Put a checkbox on the form
    2. in the workflow, 1st step, check if the checkbox is checked.
    3. if checked do nothing and stop the workflow else, do whatever is defined

    I defined 1st step as: email me the value of Draft (checkbox) and then stop the workflow

    But the workflow is still going through the steps, it is not stopped in the 1st step.

    Help!

    Tyampoo
  • 02-24-2010 08:59 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    what workflow you are talking about, do you mean that you have created a workflow in sharepoint designer that gets executed once the form is submitted. can you tell in details when the workflow gets executed. if possible attach a snapshot of your workflow

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 02-25-2010 12:17 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    Thanks for reply Qazi,

    History: I have workflow attached to the forms library. When a form is submitted say 'Expense Report' it is submitted to "Expense Report" forms library. The workflow then checks if it is new or modification of old form. If new do something. If modification check what got modified and do accordingly.

    Idea: So I thought if I could check other elements why not put Draft and check it in the first step; if true stop workflow else do what it is supposed to. Below is the snapshot.

     

    Wall: But the first step is not working.

    Questions: What am I doing wrong? Why the workflow is not stopping?

    Thanks,


    Tyampoo
  • 03-03-2010 05:46 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    Seems it worked now!

    Now i have drafts checkbox working; when checked will submit the form to forms library and workflow not triggered; when not checked it does what it is supposed to do, finally!

    Tyampoo
  • 09-12-2012 03:11 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    Hi,

     Is there a way you can send me a copy of that workflow. I'm working on something similar and would like to see it in action or how it was build. Your help is greatly appreciated.

    Thank you

  • 09-12-2012 03:13 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    Could you please send me a copy of your workflow? I'm working on a form that needs to submit when the checkbox is checked else just save with the same name. But I would like to know how the workflow can accomplish that.

    Thank you

  • 09-13-2012 12:21 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    I have a problem with my form. I have one form 2 views. The first view lets the user input their information, it allows them to edit and make any corrections on the same item if submit many times, it will not generate a new item. Ok, the first view is great. Once the internal personnel opens the request, or the second view, they are able to see the inputs and able to enter their comments or solutions entries, but when trying to save the from, it creates a new item, instead of saving to the same item. Why is this happening. also, if I try to submit on the second view it will generate a new item as well, how can I fix this issue? The first view has only one submit button. the second view has a save and a submit. I have some hidden fields on the first view that allows to edit and not override the same file or create a new one. How can I do the same for the second view?

    Please help!!!

  • 09-13-2012 12:33 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    Well, my guess would be that the fields used for the name of the form are being changed and the "new" file has a different name - that's why it isn't overwriting. Take a look at your SharePoint submit connection and see what the forumla for the file name is - take a look at the submitted files in the SharePoint library - what is the difference between the names of the new item and the original?

    Hilary Stoupa

  • 09-13-2012 01:08 PM In reply to

    Re: How to save form without submitting in InfoPath form services

    Hi Hilary,

     Thanks for your prompt response. The only difference is the time. It creates a new exact name but the time changes. I want to save on the original and keep saving till I check the checkbox and then submit the form. I guess I left the checkbox out because i'm just taking this piece by piece, once i figure out how to save the form without creating a new item, I'm sure I can figure out the submit. On the original I have just the Receive and the submit. Of course the logic to allow users to edit and submit if need to. Also two hidden fields to count strfilename and numID. On the second view i have the same time with the exception with save and submit button. I created two data connections for submitting for each button. I'm not using the orignal MainSubmit as I used on the original view. If you need detail information, please let me know, I've been working on this for couple of days without luck.

    Thanks in advance!! Your help is greatly appreciated!!

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