FieldDisplayNames
Returns a field's display names as JSON data.
Format
FieldDisplayNames ( fileName ; fieldName )
Parameters
fileName - the name of an open database file (local or remote). See Design functions.
fieldName - a text expression for the name of a field. The field name must be in the form tablename::fieldname to specify a field that exists in a table different from the current table.
Data type returned
text
Originated in version
26.0
Description
Returns a JSON object containing all the display names configured for the specified field in the Customize field display names option. See Defining advanced field options.
Example 1
FieldDisplayNames ( "" ; "Customers::FirstName" ) returns the display names for the FirstName field in the Customers table in the current file. If the display names for the default and for Table View are set to First Name and Given Name respectively, the function returns:
{"fm_common":"First Name","fm_table_view":"Given Name"}
Example 2
JSONGetElement ( FieldDisplayNames ( "" ; "Customers::FirstName" ) ; "fm_table_view" ) returns the Table View display name for the FirstName field, which is Given Name.
Example 3
Returns a custom display name in a layout calculation for a field label on a layout where space is limited. In the CustomerID field's Advanced Field Options dialog, for Customize field display names, specify a custom key named my_short_name with the value ID:
JSONSetElement ( "{}" ; [ "my_short_name" ; "ID" ; JSONString ] )
In the layout calculation for the field label, this calculation retrieves the short name:
JSONGetElement ( FieldDisplayNames ( "" ; "Customers::CustomerID" ) ; "my_short_name" )
This returns ID as the field label.