Disable submit (and message) - InfoPath Dev
in

InfoPath Dev

Disable submit (and message)

Last post 04-16-2012 03:11 PM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 04-11-2012 08:46 PM

    Disable submit (and message)

    Problem: User submits a form. User then changes some data and presses submit again. 2 versions of the form are now in the library. Same problem if a user opens a previously submitted form, makes changes and resubmits.
    Solution: I added a checkbox field and set its value to TRUE as a submit option. Under submit options I check to see if isSubmitted = false and if so I run the submit actions.

    This seems to work fine and best I can tell no submit actions are happening. BUT the browser still pops up with the message voucher created successfully (which is the text I specified for when the form is submitted)
    Is there a way to stop this message or even better give a message to say it's already been submitted.

    Or even even better! Make the submit button disabled for a form that has been submitted and still open (or re-opened at a later date)?
    Any edits after submission need to be a save, updating the original submitted form

  • 04-12-2012 03:17 PM In reply to

    Re: Disable submit (and message)

    Hey there -

    You are submitting to SharePoint Library? When you set up your submit connection, you have the option to overwrite existing. If you ensure your file name for the submit will be unique, you can safely do this - take the whole saving thing off the table - users can just submit, and their updates update the existing item.

    You have to make sure you set the file name to be something that won't end up set again - so, thinking back on the other thread you and I were talking in, if you are using some logic to set your file name field, you'd only want to run it if the field were blank, you don't want to be accidentally creating dupes....

    Hilary Stoupa

  • 04-12-2012 03:27 PM In reply to

    Re: Disable submit (and message)

    Hi,

    Yes to a sharepoint library. The problem with this is that when the form is submitted I am getting max(id) from the list to name my file so if the submit the file is named (for example) OP12.xml.
    If they make an amendment and submit again the file is saved as OP13.xml so we have 2 versions.
    I've got around it by setting a flag to true when it's first submitted and then checking this on submit to disable multiple submits but the form created alert pops up regardless.
    It is very likely that "certain" users will get confused and submit instead of save if they make edits after the first submit

  • 04-12-2012 03:40 PM In reply to

    Re: Disable submit (and message)

    Yeah, that is why I am saying do the following:

    1. Add a field to the main data source called something like "FileName"
    2. In your submit connection, use that field for your form name, and select the "overwrite existing" checkbox
    3. In your submit rules, where you have the rule to query for your data for the ID and set the file name field - only do this if FileName is blank - add a condition.
    4. Then your form gets named OP13 and keeps that name no matter how many times they click submit.
    Hilary Stoupa

  • 04-12-2012 04:32 PM In reply to

    Re: Disable submit (and message)

    I'm not sure how to if/else in the form submit or how to add multiple rules if possible.
    I already have a textbox called voucher number which is populated when the file is first submitted so I could query that but how would I say
    if vouchernumber is not blank
        submit form
    else
        create the filename
        populate vouchernumber
        submit form
    end if

    Which is what I'd do in other environments.

    I've added an image of my current form submit rule - hopefully this will work as it's a shared link from skydrive

    https://skydrive.live.com/redir.aspx?cid=c18b04d5bb544db4&resid=C18B04D5BB544DB4!151&parid=C18B04D5BB544DB4!136&authkey=!AJf5O3n6x0QXp_w

  • 04-12-2012 05:55 PM In reply to

    Re: Disable submit (and message)

    You have multiple actions on a single rule.

    I am suggesting spliting some of those actions out onto new rules.

    See the New button in your screenshot? Click it and select Action.

    Your new action rule can have a condition, like "VoucherNumber is blank" - and then can run your query and set your voucher number field.

    Your other rule can perform the actual submit.

    Does this make sense?

     

    Hilary Stoupa

  • 04-16-2012 03:00 PM In reply to

    Re: Disable submit (and message)

    Perfect thanks. Problem was that I was setting the filename which included max(id) in the submit data connection.

    So I made sure that the submit used the vouchernumber field to name the file and not try to recalculate the max(id) for each submit.

    I now have 2 actions on form submit.
    If vouchernumber is blank
         create voucher number and populate field
         submit the form

    If vouchernumber is not blank
        submit the form

    I have allowed overwriting in the form library and now all works great.
    Thanks for all the help

  • 04-16-2012 03:11 PM In reply to

    Re: Disable submit (and message)

    You bet - I'm happy you got it all sorted out!

    Hilary Stoupa

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