Just made a really interesting discovery--one that allows you to set the "On Click Action" for External rules!
I remembered that iLogic forms are controlled by XML files. A little experimenting confirmed that you can actually edit the XML file (with one very simple edit) and use any of the On Click actions for External Rules buttons.
You can only do this for Global Forms, not local document Forms, because there's no XML file to edit for local Forms. But there's a simple workaround for that: just copy/paste your Local Form into the Global Forms area, perform the workaround, then copy/paste the form back into the local document Forms area.
All that said, here are the instructions for the XML workaround:
- Right-click in an empty area of the Global Forms tab, and click Open Containing Folder.
- Locate the file with the name of your form (the one WITHOUT .state at the end). Right-click the file, point to "Open With", and click "Notepad".
- Hit Ctrl+F and type the name of the External iLogic rule. Click "Find Next" until it highlights a line that says <RuleName> at the beginning.
- Directly below this line should be a line that starts with <RuleButtonBehavior> (this is the "Start Tag") and ends with </RuleButtonBehavior> (this is the "End Tag"). Right now it should say "RunRule" between the Start and End Tags.
- Erase the the text that's currently between the Start and End Tags, and replace it with the appropriate text for the action you want (see table below).
- Save the XML file and close it.
- The External iLogic button should now perform the desired "On Click Action".
Here are the respective RuleButtonBehavior values for each On Click Action:
On Click Action | RuleButtonBehavior
===================================================================
Run Rule | RunRule
Close and then Run Rule | CloseAndRunRule
Apply and then Run Rule | ApplyValuesAndRunRule
Apply and then Close and then Run Rule | ApplyValuesCloseAndRunRule
Again, the respective RuleButtonBehavior value should go between the start and end tags in the XML file. So if you want the On Click Action to be "Close and then Run Rule", then the line below <RuleName> in your XML file should look exactly like this:
<RuleButtonBehavior>CloseAndRunRule</RuleButtonBehavior>
As far as I can tell, you're free to edit the External rule button using the Form Editor after this (such as to give it a tooltip), and it won't wipe out the On Close Action that you gave it.
There could be some undesired consequences from doing this, but as far as I can tell it's perfectly safe. It's simply changing a property that's already present in the button's underlying code, but for some reason isn't exposed in the Rule Editor UI. If anyone runs into any issues with it though, please let me know.
So unless this causes any issues, I can't see any reason why this wasn't exposed in the UI... would definitely be nice if it could be added in so we don't have to go through all this hassle.