Command button name as an action contraint

I have two buttons for adding a Credit Card surcharge “Add3” and “Add5”

To keep the number of rules to a minumum, I am trying to have just one rule, which will execute either one of two possible actions once triggered (depending on whcih button was pressed).

But I seem to be getting somehting wrong. I have read that you need to use printer tags in the contraint box, but I was wondering if there is any chance it’s possible to read the AutomationCommandName?

This is what I have right now, but at the moment all the actions are executed, instead of just one…

That should work, given you are using the correct syntax in the Constraints.

What is the problem? Is the Rule not firing? Is it firing the wrong Actions?

Ensure you are using the AMC Name, not the AMC Header, and that you are using matching case.

It’s firing both actions, which seems very odd.

If I use Show Message for [:AutomationCommandName] is does show a popup for the correct button name, but when used as a constraint it doesn’t seem to work.

I must be using the Name and not the Header because it is working correctly for the overall contrainst for the rule above.

I was a little under of the syntax I should use for the contraint.

You have the syntax correct for Actions. It should not fire both Actions.

Ensure you don’t have another Rule that is firing. You can use the Rule Debugger to find out if another Rule is interfering.

1 Like

DOH! - Spot on, I had an old rule from a long time ago which was messing this up. I Feel pretty stupid right now :pensive:

1 Like