Script Execution Before Rules Being Applied

E

eczino

I have scripted a confirmation box for a button that also has rules
defined for it. The problem I am having is that I want the script to
execute before the rules are applied, as I only want the rules to be
applied if the user selects "Yes" to the Confirmation Box.

As it is now, the rules are applied (and all actions associated with
them) and then the Confirmation Box is displayed. Is there a way to
reverse this?

Thanks,
Elliot
 
C

Clay Fox

Rules always run before code in InfoPath, which can be a pain.

One work around is to put your code on a field change. Add a field for this
purpose.
Change the field value as the first rule action.
This will trigger the code and then it will return and complete the rules on
the button.
Otherwise there may be a way to hook into the message box result, but I have
not tried this.
 
Top