Within the same object (say, a button), actions are run from top to down, the first in the list of actions will run first, and so on. If you have some OnOpen triggered actions, this will run prior to any other action.
On this topic, I have a button that runs 3 actions:
1. Select in Field: Field=%PointInTime, Search string = (Daily*|MTD*|QTD|YTD)
2. Run a macro (enables/disables chart expressions)
3. Set Variable: Variable=vPiT_Choices_LastSet, Value = Concat(DISTINCT %PointInTime,',')
Looking at this you would expect the variable in step 3 to set to the result of the Select in Field action (step 1) which is what I want. However, you have to click the button twice for this to work. My tests are showing that the result of step 1 is ignored by step 3.
There seems to be an undocumented rule like "Set before select" ... call it a bug or not ... If you have a block of actions within a button or textbox or trigger and intend to use a SET VARIABLE action after a SELECT-action (like SELECT FIELD or CLEAR FIELD or others....) and you expect to get the result from that selection into the variable, you will NOT get it. The variable will be set before the selection change becomes effective, no matter in which sequence you put it.
This is the status until today (QV 11.2 SR3)
WORKAROUND - HELP WITH ANOTHER TRIGGER (Not for Ajax!)
If you like to get a field value into a variable after you changed the selection in the same action, you will need the following "ingredients":
a new field, not linked to any other data,
A on-select trigger on that new field
The action itself will first define, a) which variable to change and b) the expression to execute into two temp-variables and
then set the new field (the one with a trigger) to a dummy value.
The on-select field trigger, finally, sets the expression (as given in a temp variable) into the desired variable (whose name was also given in a temp variable).
The point of time, when the on-select field trigger is executed, is then indeed AFTER the selections made by the action button and will deliver the desired result. It is demonstrated on the below example, where the green action button
captures the current selection of FieldX into variable A
changes the FieldX selection
captions the new selection of FieldX into variable B
I have to admit, that the Ajax Client only executes one action block at a time. If one action sets a field, which has a trigger on it, Ajax client (or Web preview) does not execute the trigger. If you manually change the field (the one with the trigger) in Ajax, the trigger will be fired. So: My above example is not Ajax-ready!