project BLF > class ComponentPool > method GetTranslationForObject
Description
Lookup the actual translation of a translatable business field for one specific business object.
Parameters
iiObjectID | input | integer | id |
icLanguageCode | input | character | Language |
icOriginal | input | character | original text |
icFieldName | input | character | Specify the field name, in case TranslationStringText contains more than one field. |
ocTranslation | output | character | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
BLF
QadFinancials
program code (program1/componentpool.p)
/* ======================================================= */
/* Default the translation with the original/native string */
/* ======================================================= */
assign ocTranslation = icOriginal.
/* ======================================================= */
/* Return in case the required info is missing */
/* ======================================================= */
if icLanguageCode = "":U or
icLanguageCode = ? or
iiObjectID = 0 or
iiObjectID = ?
then return.
/* ============================================================================================================ */
/* Componentpool cannot contain database access as it will be run before the application database is connected. */
/* Delegate the database access to the cacher class. */
/* Ensure we return the original in case there was no translation found (ocTranslation is empty) */
/* ============================================================================================================ */
<M-50 run StartCacherInPool (output vhFcComponent (ohCacher)) in ComponentPool>
<M-32 run GetTranslationForObject
(input icLanguageCode (icLanguageCode),
input iiObjectID (iiParentObject_ID),
input icFieldName (icFieldName),
output ocTranslation (ocTranslation),
output oiReturnStatus (oiReturnStatus)) in Cacher>
if ocTranslation = "":U or
ocTranslation = ?
then assign ocTranslation = icOriginal.