If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Localizing Value Lists for Data Combo Boxes

A Data Combo Drop-Down field displays a list of records from another table in the database. By specifying a SQL statement, you define the drop-down list's contents from the corresponding table or entity. To localized the list's contents, you utilize the functions fnGetLocalStringByCultureStringID or fnGetLocalStringByCultureStringName to extract cultures for values of a data combo drop-down field.

The steps below provide an overview of how to localize the values in a data combo drop-down field:

  1. Open the Values record (or create a new one if one does not exist) that is associated with the data combo drop-down field that you want to localize.
  2. Determine which functions you want to use to extract the localized values from the culture string. The available functions are:
    • fnGetLocalStringByCultureStringID (CultureStringID, BaseString): Use this function to specify the ID of the Culture Strings record. This function will work for values which are static and, regardless of value, return a single local string. This is the recommended approach whenever possible to ensure the correct local string is returned. The parameters that are associated with this function are:
      • CultureStringID: The ID of the Culture Strings record.
      • BaseString: The name of the base string associated with the Culture Strings record.
         
    • fnGetLocalStringByCultureStringName (CultureStringName, BaseString): Use this function to specify the Name of the Culture Strings record. This function should be used when you do not know the ID of the Cultures String record and when more than one local string can be returned. The parameters that are associated with this function are:
      • CultureStringName: The Name of the Culture Strings record.
      • BaseString: The name of the base string associated with the Culture Strings record.
         
  3. Specify a SQL statement to define the drop-down list's localized contents.
    • For example, if you want to show a data combo drop-down field that displays the records from the Member Type service as localized values, you could specify the following SQL statement in the Values record's Value field:

      SELECT ID, [dbo].fnGetLocalStringByCultureStringName(Name,Name) Value FROM [APTIFY].[dbo].vwMemberTypes



    • In this example, the Member Type.Name field is being passed in for both the CultureStringName and the BaseString. So, this example assumes that the name of the Cultures Strings record and the base string are the same.

      Note Concerning Culture String Naming Conventions

      When using the SQL function fnGetLocalStringByCultureStringName to localize the value list for a SQL-sourced data combo box, you need to pass in both the Culture String Name and the Base String. For these situations, the simplest approach is to use the same value for the Culture String Name and the Base String for strings that you plan to localize using this function. For example, if you want your data combo drop-down field to display the records from the Member Type service, the Name and the Base String for the Culture Strings record associated with an individual member type could both be Individual Member to simplify the setup of the fnGetLocalStringByCultureStringName, so that you only need to identify and pass in one value to the function. 

  4. Select OK to close the Values record.
  5. Select OK to close the Fields record.
  6. Save and close the entity.

Below is an example of a SQL-sourced data combo box. On the left, the user is tied to the EN culture. On the right, the user is tied to the French culture.

Localized Data Combo Box Example

Copyright © 2014-2017 Aptify - Confidential and Proprietary