Using rules with the submit button - InfoPath Dev
in

InfoPath Dev

Using rules with the submit button

Last post 01-08-2009 03:07 PM by warrtalon. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 01-08-2009 10:30 AM

    Using rules with the submit button

    I am trying to build a company form that relies heavily on rules.  I would like the form to not submit when a rule is broken, and submit when it does.  I have built the rules in to the submit button to run when clicked.  However the form still submits even when an error occurs, or rather, it tells me an error occured, then tells me the form was submitted successfully, doesn't submit, then closes.  I definitley need the form to close.  Is this possible to do without using code?  Any suggestions on how to work around this?

     Thank you!

    Filed under: ,
  • 01-08-2009 10:40 AM In reply to

    Re: Using rules with the submit button

    Without writing code, it might be possible to set a value in a sperate field and change the conditions in your rule to querry for that field. You can setup a a validation check for that change when you submit.

  • 01-08-2009 10:45 AM In reply to

    Re: Using rules with the submit button

    But how does that still prevent me from submitting a form with errors?

  • 01-08-2009 11:06 AM In reply to

    Re: Using rules with the submit button

    This should work:

     Open up the Rules dialog for your submit button:

    Add a rule: Condition: (whatever condition you want to use to determine the form is invalid)  Action: Show an error message
    Check the box for "Stop processing rules when this rule finishes"
    Add another rule: Condition: none  Action: Submit the form

    If you do that, the submit should only take place when the form's content is valid.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-08-2009 01:04 PM In reply to

    Re: Using rules with the submit button

    Thanks Jimmy.

     This appears to work, but it still doesn't address my issue of having the form closed.  It stays open. 

     Also, I had to enter this in tools>submit options>advanced because I couldn't select a close/leave open option in the submit rules.

     Any more advice?

     Thanks again.

  • 01-08-2009 01:27 PM In reply to

    • Goodboy
    • Not Ranked
    • Joined on 01-08-2009
    • DC
    • Posts 3

    Re: Using rules with the submit button

    In your rules screen after the submit action, add another action.  Select the action close the form.  You can check/uncheck the box if you want the user to save the form or not.

  • 01-08-2009 01:52 PM In reply to

    Re: Using rules with the submit button

    I dont have a 'close the form action'?  All I ahve is show a dialog box message, show a dialog box expression, switch views, set a field's value, query using a data connection, submit using a data connection, open a new form to fill out.  I am using Infopath 2007 SP1.

  • 01-08-2009 02:50 PM In reply to

    Re: Using rules with the submit button

    "Close the form" is one of the standard actions in the Rules box and is even available for browser forms.  You really don't see it anywhere when clicking "add action"?  I use the Close action in every form I make right after the submit so that it closes cleanly without any Save prompts.

  • 01-08-2009 03:01 PM In reply to

    Re: Using rules with the submit button

    In the button properties, please change the dropdown box from "Submit" to "Rules and Custom Code" and then set up the rules.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-08-2009 03:02 PM In reply to

    Re: Using rules with the submit button

    Thank you!  There is a difference in actions on the submit button and the tools>submit options.  It appears to work in my simple, dummy form, now I will try and add it to our work form, which is a more complex (more rules, options, etc.)


    Thank you for all of your help.

  • 01-08-2009 03:07 PM In reply to

    Re: Using rules with the submit button

    Interesting, I never use the actual "Submit" function but rather the "Rules and Custom Code" then re-label the button as "Submit," so I've never noticed this discrepancy...

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