Localizing Static Values Lists for Views
When a field with a static value list is added to a view, the actual value of the field is displayed, not the localized value. To display the localized value in a view, you must create a virtual field on the top level entity to display localized values in a view. This is done by calculating the value of the virtual field with the SQL function fnGetLocalStringByCultureStringID to extract the culture strings associated with the values of the list.
The steps below provide an overview of how to create a virtual field to display localized values in a view:
- Open a new Fields record in the entity that includes the static combo box that you want to localize.
- Configure the necessary information in the top-area and on the field's General tab.
- Go to the Options tab and make sure the In Table option is cleared.
- The Virtual Field tab is enabled.
- The Virtual Field tab is enabled.
- Go to the Virtual Field tab and select Calculated as the Virtual Field Type.
Enter the appropriate syntax to display the static list values as localized. Below is an example of the syntax you can use where NameOfComboBoxField is replaced by the name of the field with the static value list and NameOfEntity is replaced by the name of the current entity.
SELECT dbo.fnGetLocalStringByCultureStringID(
(SELECT ISNULL(ValueCultureStringID,-1)
FROM dbo.vwEntityFieldValues ef
INNER JOIN dbo.vwEntities en ON ef.EntityID=en.ID
WHERE ef.Value=NameOfComboBoxField AND en.Name='NameOfEntity'), NameOfComboBoxField)
- Select OK to close the Fields record.
- Save and close the entity.
Below is an example of a view that includes the value of a standard static list-based combo box (the Standard Combo Box field) and a localized virtual field (the Static Value field).
Copyright © 2014-2019 Aptify - Confidential and Proprietary