Using APP_ID in Translations

Just a quick note: When you are working with a multilingual/translated APEX Application you sometimes need to join LOV Values in your SELECT Statement.

Given Example, you have a report which reads from some table and joins the values you have defined in a Static LOV

SELECT SOME.A
     , SOME.B
     , LOV .DISPLAY_VALUE
  FROM SOME_TABLE SOME
     , APEX_APPLICATION_LOV_ENTRIES LOV
 WHERE LOV.APPLICATION_ID      = :APP_ID
   AND LOV.LIST_OF_VALUES_NAME = 'MY_TRANSLATED_LOV'
   AND LOV.RETURN_VALUE        = SOME.C

This works fine, until you are in a multilingual environment where the LOV entries are translated to the respective target language. With the given SELECT you would display the LOV Entry as defined in the main application, not the translation.

To access the Translation you need to use :APP_TRANSLATION_ID

SELECT SOME.A
     , SOME.B
     , LOV .DISPLAY_VALUE
  FROM SOME_TABLE SOME
     , APEX_APPLICATION_LOV_ENTRIES LOV
 WHERE LOV.APPLICATION_ID      = :APP_TRANSLATION_ID
   AND LOV.LIST_OF_VALUES_NAME = 'MY_TRANSLATED_LOV'
   AND LOV.RETURN_VALUE        = SOME.C

Leave a Reply

Your email address will not be published. Required fields are marked *