locked
How can I distinguish whether the form was submitted or saved RRS feed

  • Question

  • I currently have my form created when a user inputs into the field “File Name” and clicks “submit”. It is a required field and makes the form easily distinguishable from each other. My question is how do I know when the user “submits” or “save” or do I care? I like to give user the ability to save form when they are filling out, hence the “save” and the “submit” button on toolbar. Should I create a custom button instead?


    Tuesday, June 7, 2011 8:41 PM

Answers

  • Ricky, if there are different naming conventions, then why are people typing in the filename?  It should still be auto-generated BASED on their naming convention - it should be automatic, and you should put the naming logic in the form, then base it off the user's department or whatever.  If they type it in, you will be hosed.

    You can't save a file without creating a filename, so your Save button and Submit button will have to use the same filename.  You still need to use the technique in my article even if the user types the filename.  Both your Save and Submit buttons will do the same submit with the same filename, because a file can't be saved without a filename.  So, the difference between your Save and Submit buttons will be that they each have a rule that sets a hidden field to the value of "saved" or "submitted," and then the rest of your process/workflow logic runs based off this field's value.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    • Marked as answer by David HM Thursday, June 16, 2011 1:45 AM
    Thursday, June 9, 2011 2:20 AM

All replies

  • Save should never be allowed unless there is a specific business requirement to have it.  Also, the user should never type in the filename.  You said this "makes the form easily distinguishable from each other," but how is that possible if the user types in the filename?  What if two users type the same thing?  The result is the existing form gets overwritten.  What if they use spaces?  The filename will be jacked up.

    Neither Submit nor Save (nor anything except Print Preview) should typically be visible in the toolbar.  Instead, disable all that stuff and use your own custom submit buttons, because you can put all sorts of rules and conditional formatting on those - far more robust and much cleaner.

    InfoPath – Auto-Generating Filenames

    To answer your question directly, you can't distinguish between the two currently unless you're performing some recognizable actions in your Submit options that leave a trace somewhere that you can check.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force

    Wednesday, June 8, 2011 2:43 AM
  • You can disable toolbar options of save and submit.

    create two new buttons may be as "Save as Draft" and Submit. Create two fields having true/False datatype. Update it on the click of each button. These will help to know that whether it was saved as draft or final submit.


    Dare to promise
    Wednesday, June 8, 2011 2:48 PM
  • Thanks for your reply. I think I better explain my situation more clearly.

    I'd like to have 2 custom buttons (remove toolbar options) - one "save" and one "submit". The problem I am having is the user needs to input a name first (required - file name) so that the XML gets created in the forms library. I do not dynamically create the file name, reason being that each business line has a different standard naming convention and we have many. That is where the Submit button is used only once. The save button would only be used when the user has a long form to fill out and wants to postpone till later. How can I accomplished this? Maybe the two fields true/False datatype method would work but I do not know how to accomplish. I have played around with rules and conditions with no luck. Help!

    Wednesday, June 8, 2011 7:08 PM
  • Ricky, if there are different naming conventions, then why are people typing in the filename?  It should still be auto-generated BASED on their naming convention - it should be automatic, and you should put the naming logic in the form, then base it off the user's department or whatever.  If they type it in, you will be hosed.

    You can't save a file without creating a filename, so your Save button and Submit button will have to use the same filename.  You still need to use the technique in my article even if the user types the filename.  Both your Save and Submit buttons will do the same submit with the same filename, because a file can't be saved without a filename.  So, the difference between your Save and Submit buttons will be that they each have a rule that sets a hidden field to the value of "saved" or "submitted," and then the rest of your process/workflow logic runs based off this field's value.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    • Marked as answer by David HM Thursday, June 16, 2011 1:45 AM
    Thursday, June 9, 2011 2:20 AM
  • Hey Ricky - on the other question you have about save vs submit - open a new thread liek Clayton suggests and I can assist you there. That old one is now locked.

    Thanks,

    Debi

    Thursday, June 9, 2011 1:55 PM
  • People are typing in different names on form while complying with our naming conventions, every business line saves the form according to their application name followed by a descriptive qualifier. Since these can be many, it is virtually impossible to know what name they are going to place on form and cannot have auto-generated file names.

    I did follow your article on creating a submit button on my test form and it worked fine but I would like to also have a save button to be hidden until the user submits (Required Field - File_name ). Once submitted, the button is hidden and only the save button is visible and always present. Can this be done?

    Can I also have the user get an email saying that it has been submitted with a link to form?

    Thanks for any assistance, I've only had a few months of using Infopath and need help.

     

    Thursday, June 9, 2011 6:00 PM
  • Hi Ricky - I am happy to tell you how I did the save vs. submit button and the followup email with the link. I will not be much help with the naming conventions though since I have standard ones that are autogenerated based on name and date etc....

    My form buttons (save and submit) are based on the workflow status of the form. Are you familiar with workflow?

    Thursday, June 9, 2011 6:24 PM
  • Hi Debi - no experience with workflow but if you can send me links/information, I will read up on how to implement. I think it will prove invaluable for the users. Thanks
    Friday, June 10, 2011 11:52 PM