The SetInitialValue command enables the template author to assign an initial value to a data element in the data capture interview.
An example would be the VAT percentage, which is likely to stay constant at a particular value but might change with time or with specific goods being sold/bought. The command would be used like this:
«SetInitialValue(VATPercentage,14)»
Where an initial value is needed for a repeating item, this can be done in one of two ways, for example:
«ForEach(InvoiceLineItem)»
«SetInitialValue(VATPercentage,14)»
... other commands laying out the invoice ...
«End()»
Or, outside the scope of a ForEach, but nonetheless indicating an initial value for all instances of the repeating item:
«SetInitialValue(InvoiceLineItem/VATPercentage,14)»
Note that an initial value is not a default value – it can be modified by the user and once modified retains that value. Whereas a default value can be thought of as implying that if the data element is left blank then some other value will be provided for it.
The SetInitialValue command was introduced with Version 3 of XpressDox and is unavailable in previous versions