Rule on submit button does not execute if there are errors - InfoPath Dev
in

InfoPath Dev

Rule on submit button does not execute if there are errors

Last post 08-22-2009 10:56 PM by Qazi Anis. 17 replies.
Page 1 of 2 (18 items) 1 2 Next >
Sort Posts: Previous Next
  • 07-30-2008 04:59 PM

    Rule on submit button does not execute if there are errors

    Hi,

     I've added a rule to the submit button on my browser-enabled form, that will set the value of a field to 1.

     However, I've noticed that the rule only seems to execute if the submit is successful (there are no validation errors), even if I place the rule to set a field's value *above* the rule to submit the form.

    Does anyone know a way of getting my rule to execute, even if the form has errors and cannot be submitted?  I don't want to do this with code.

     Cheers

    Miowmix2

  • 07-30-2008 10:07 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Rule on submit button does not execute if there are errors

    Hi,

    In the rules window “set the value of a field to 1” rule should be displayed first and second rule should be submit. In this cases first rule will be executed even second rule is failed.
    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 07-30-2008 10:26 PM In reply to

    Re: Rule on submit button does not execute if there are errors

    That's what I thought should happen too, but the first rule is not executing :?

  • 07-30-2008 10:30 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Rule on submit button does not execute if there are errors

    What is your first rule and are you getting any error while executing first rule?

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 07-31-2008 03:04 PM In reply to

    Re: Rule on submit button does not execute if there are errors

    Hi,

    On the submit options dialog I have 'allow users to submit this form' and 'perform custom action rules' selected.

    Then in the rules dialog, I have my rule to set the form-field value above my rule to submit the form.

    This rule to set the value of the form-field is 'set a field's value: formSubmitted = "yis"
    Condition: None - This rule always applies

    When I submit my form without filling in all the fields it shows the default 'cannot submit because it contains validation errors' message - this is fine...

    But the value of formSubmitted is not updated...

     

    Hopefully these pictures will indicate something really simple that I'm doing wrong!

    Thanks

     Miowmix2

     

  • 07-31-2008 03:13 PM In reply to

    Re: Rule on submit button does not execute if there are errors

    Hi --

    I don't think you are doing anything wrong -- when I first saw your post I put together a quick demo and had exactly the same results. It seems that the validation errors prevent any rules in the submit from being run.

    I wonder if you used a regular button and added rules to it (so that the button's action was Rules and Custom Code instead of Submit) and had your rules in the same order, if you would have the same issue? Of course, that means you wouldn't want to show the Submit menu item or tool bar -- you'd want to limit users to the button on your form. It may be worth a try!

    Hilary Stoupa

  • 07-31-2008 03:31 PM In reply to

    Re: Rule on submit button does not execute if there are errors

    Thanks for the tip, Hilary - I set up a regular button with the same rules and it worked perfectly.

    The only downside is that it brings up an alert box with 'some rules were not applied' which isn't as nice as the default 'cannot be submitted' error, but I will have a fumble with the settings and see if I can change that behaviour.

    YAYA!

    Miowmix2

  • 08-06-2008 12:30 PM In reply to

    Some rules were not applied error

    I have a form that has two submit buttons using two different data connections. The first button works fine and the form is sent to a sharepoint list. Once the form is opened from the sharepoint list there is a second button that is suppose to send an email reply, based on a field in the form, to the original sender of the form and also send the form to another sharepoint list. whenever we try to use the second submit button we recieve a "some rules were not applied error". Help please

  • 08-06-2008 06:48 PM In reply to

    Re: Some rules were not applied error

    What do the details say on the error message on the rules?
    Hilary Stoupa

  • 08-07-2008 06:41 AM In reply to

    Re: Some rules were not applied error

    The details on the message say:

    InfoPath cannot submit the form.
    Some rules were not applied.
    InfoPath cannot submit the form.

    I also noticed that when i change the button properties on one of the submit buttons, it changes it on the other one as well.

  • 08-07-2008 07:07 AM In reply to

    Re: Some rules were not applied error

    If I recall correctly, there is a button on the error message pop up you can click that will open an area below it with more details on the error -- that may help you track your problem.

    If both buttons are set to use "Submit" any change to the form's Submit Options will affect both buttons. You may need to use Rules and Custom Code for the button's action, then set a rule that has the action of submitting the form and select the correct submit action for each button.

    Hilary Stoupa

  • 08-07-2008 08:14 AM In reply to

    Re: Some rules were not applied error

    Ok I tried using the Rules and Custom Code for the buttons action and set a rule of submitting the form for each button and it still didn't work. So I removed the second button and used on submit button that had different rules and submit actions set up based on a fields value in the form. It worked the first time I tried it, sending the form to two different locations, however when I tried it a second time I received the some rules were not applied error.

     If you have multiple rules set up on a submit button, do all rules have to be true everytime the form is submitted?

  • 08-07-2008 08:36 AM In reply to

    Re: Some rules were not applied error

    I'm not sure -- I wouldn't think so -- I would think that would be handled by conditions -- you set your conditions to create the scenarios where each rule will run. By "it still didn't work" what do you mean? You had the same error that not all rules were applied? Did you look on the warning to see if there is button you can click that will give you the details as to why the rules were not applied? When I intentionally cause rules not to run on a form I use, the warning box has a button that says "Show Details". If you click that button you will get some better information on what is happening.

    Edit: Sorry, I realized that you did post the details above -- the form can't be submitted.

    Hilary Stoupa

  • 08-07-2008 08:51 AM In reply to

    Re: Some rules were not applied error

    One more note -- I would think that if you set a rule on a button that was using Rules and Custom Code, and your rule action was to submit a form using a submit connection, and you get the "rules not applied / cannot submit" error -- you may want to look at that submit connection. It could be something wasn't set up correctly for it.

    Hilary Stoupa

  • 08-08-2008 10:38 AM In reply to

    Re: Some rules were not applied error

    ok so it working for a day or so and now i'm gettint the "some rules were not applied error message again" What I've noticed is that the form is submitting successsfully to the two sharepoint lists but when it attempts to send the user an email it fails and gives me the "some rules were not applied message" I'm totally lost at this point. I've checked all my data connections and rules and they look fine.
Page 1 of 2 (18 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.