Dynamically Change Field Layout by Data
By default, the layout of an Anveo Page is static and does not change. If you want to change the appearance at run time, e.g. colorize fields under certain conditions, highlight or replace field content, you can use your own code.
Dynamic field adjustments in the Anveo Mobile App can be defined using Anveo Script. The Action Code has to be set into OnAfterGetRecord – Action property of an Anveo Page Element. Anveo Script provides a set of options to change the field layout at runtime. A central role is played by command PAGE using first parameter SFA (= Set Field Attribute). The complete call of the function PAGE to implement a dynamic field change has the following form:
- Fieldname is the Field Name of the field.
- Attribute is the name of the attribute.
- is the new value.
The second parameter must be an empty string due to future features.
List of attributes:
Sets the text color of a field. The color must be defined using hexadecimal number such as #FF0000.
Sets the background color of a field. The color must be defined using hexadecimal number such as #FF0000.
Sets the alignment of text within a field (only on cards available). Possible values are:
left, right, center.
Sets the weight of the font in a field. Possible values are: bold, normal, italic, bold_italic.
Sets the font size of the font in a field in percent (only on cards available).
Sets the visibility of a field. Possible values are: 0, 1.
Sets whether the field is editable or not (only on cards available). Possible values are: 0, 1.