There are some powerful commands in XpressDox which enable the template author to retrieve data or modify the interview when focus moves from one control on the interview to another. These are the commands OnExitSet, LinkToDatasource, and similar commands.
But sometimes the template author would like the user to initiate those actions (database retrieval, modification of data elements, etc.) explicitly. This is the function of the Button command.
«Button(XXX)» will result in a button appearing on the interview. On its own, it means not very much, because clicking it will result in no action.
But as soon as one of the actions above is linked to it, such as
Then the action defined by that LinkToDataSource command will be executed – in this case an account row whose Id is in the AccountNumber data element will be retrieved from the Accounts data source, and the data elements defined in that row will populate the data set (and the interview where relevant).
The data element XXX is really a kind of place holder, and will be removed from the data set as soon as the interview is complete. So don’t be tempted to make it one of the data elements that will appear in the assembled template.
Note that the actions associated with OnExitSet, LinkToDataSource and LinkToOtherData will be executed when the user clicks the button in the interview, not when the focus leaves the control, which is the usual way that those actions are triggered.