AX2293
Action codes quick reference
This topic is a quick reference for action codes. See the detailed topics in this section for more information.
What can action codes do?
Action codes can be used to:
- Copy formats, formulas, and/or values from one location in a sheet to another. For more details on defining copy actions, see Setting up copy actions.
- Lock or unlock cells in a sheet. For more details on defining lock or unlock actions, see Setting up lock and unlock actions.
NOTE: Action code processing can be resource-intensive. When designing action codes in a file, care should be taken to minimize the performance impact of this process. The number of actions and the frequency of their processing should be limited to only processing when absolutely necessary.
What triggers action codes?
Action code processing in a sheet is triggered by the following events:
-
Refreshing Axiom queries. If only the current sheet is refreshed, then only the action codes on that sheet are processed. If the whole workbook is refreshed, then all action codes are processed. Named ActionCodes tags are ignored.
-
Inserting or overwriting a calc method on the sheet. Action codes are only processed for the rows impacted by the insertion or change operation. Named ActionCodes tags are ignored.
-
Running the Process Action Codes command. The behavior depends on whether an ActionCodes tag name is specified. If no name is specified, then all action codes in the workbook are processed (excluding named ActionCodes tags). If a name is specified, then only the named ActionCodes tag is processed.
Administrators can use the Action Codes group on the Axiom Designer tab to process any set of action codes on demand, without depending on Axiom queries or other means of triggering action code processing. This is intended for testing the action codes setup. See Using the Axiom Designer tab.
How are action codes defined in a sheet?
Action code processing depends on the placement of reserved tags in the sheet. There are two components:
- The ActionCodes tag, which defines a control column and a control row for the action code processing.
- Matching action tags to specify "action cells" for processing. Each intersection of matching action tags in the control column and the control row specifies an action cell for processing. The paired tags specify the action to perform.
Tag Type | Tag Syntax |
---|---|
ActionCodes primary tag |
[ActionCodes] |
Lock action tag pairs |
[Lock;TargetSize] [Lock] |
Unlock action tag pairs |
[Unlock;TargetSize] [Unlock] |
Copy action tag pairs |
[Copy;SourceLocation;TargetSize;PasteType] [Copy] |
Action codes perform the copy, lock, or unlock action on the action cell. Action cells are defined by the intersection of matching action tags.
You can have lock, unlock, and copy pairs within the same action control row and control column. You can also do the following:
- Combine lock, unlock, and copy tags within the same cell, by delimiting the tags with a comma. For more details, see Combining action tags.
- Define "named" action tags, so that action tags only "match" with other tags that have the same name. For more details, see Using named action tag pairs.
- Define "named" ActionCodes tags, in order to explicitly process that set of action codes on demand. For more details, see Defining the ActionCodes tag.
Action code examples
The following are examples of action code tags. Only the "primary" tag is shown, meaning, the tag that contains the parameters to define the copy, lock, or unlock action. All tags must have a corresponding "simple" tag to define the action cell.
NOTE: For copy actions, if TargetSize is not being specified, but you want to specify the PasteType, you can simply omit the unused parameter. You do not need to delimit the unused parameter with an "empty" semicolon (although that will also work).
Example | Description |
---|---|
[Copy;A10] |
Copies a specific cell (A10) to the action cell. |
[Copy;+0;Values] |
Copies the contents of the action cell back into the action cell as values. For example, this could be used to convert a formula to a value, within the same cell. The offset +0 is used to specify the action cell as the source location. |
[Copy;A10;Formats] |
Copies the format of a specific cell (A10) to the action cell. |
[Copy;A10;1x3;Formats] |
Copies the format of a specific cell (A10) to a three-cell high block starting at the action cell. |
[Copy;A10;2x2;Formats] |
Copies the format of a specific cell (A10) to a block of cells two columns wide and two rows high, starting at the action cell. |
[Copy;+8-2] |
Copies a cell that is 8 columns to the right and two rows up from the action cell. |
[Copy;B:1x3;Formulas] |
Copies formulas and number formats from a three-cell high block that starts in the cell that is located in column B, in the same row that contains the action cell. These formulas are pasted into a three-cell high block starting at the action cell. |
[Copy;B;3;Values] |
Copies values from the cell in column B, in the same row as the action cell. The values are pasted into a three-cell wide block starting with the action cell. |
[Copy;A10:3x2;FormulasOnly] |
Copies formulas only from a block of cells three columns wide and two rows tall, that starts at a specific cell (A10). The formulas are copied into an equivalent block of cells that starts at the action cell. |
[Copy;B-2:1x2;Formats] |
Copies formats from a two-cell high block of cells that starts at the cell in column B and two rows up from the action cell. The formats are copied into an equivalent block of cells that starts that the action cell. |
[Lock] |
Locks the action cell. |
[Lock;4] |
Locks a four-cell wide block of cells that starts at the action cell. |
[Lock;1x4] |
Locks a four-cell high block of cells that starts at the action cell. |
[Unlock] |
Unlocks the action cell. |
[Unlock;4] |
Unlocks a four-cell wide block of cells that starts at the action cell. |
[Unlock;1x4] |
Unlocks a four-cell high block of cells that starts at the action cell. |