Consultor Eletrônico



Kbase P38940: How to manage the translation of Data in smart data fields (
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/27/2003
Status: Unverified

GOAL:

How to manage the translation of Data in smart data fields (combo lookups)?

FIX:

Here is a suggestion for Lookups.  It might be possible to achieve the same for a combos:

Implement an outer-join to a translated table in the query of the lookup with something like:
FOR EACH table NO-LOCK,
FIRST transTable OF table OUTER-JOIN NO-LOCK
 WHERE transTable.language_obj = DYNAMIC-FUNCTION("defaulttranslateobj")

To handle the case when there is no translation record in transTable, you shall do use the lookupDisplayComplete lookup hook. (to use in a super procedure of the lookup)

Description of lookupDisplayComplete:
Run after lookup displays values into the lookup field and linked widgets
INPUT   pcFieldNames    CHARACTER
INPUT   pcFieldValues   CHARACTER
INPUT   pcKeyFieldValue CHARACTER
INPUT   phLookup        HANDLE


The idea is to find out that the displayedField is blank in pcFieldValues (because no translation available) and then replace the screen-value by the original data (still in pcFieldValues, find where thanks to pcFieldNames).  In this case, you might even show that no translation is available by changing the color, or adding a '*' to the screen-value.