project BLF > class BTranslation > method DataNewByParent

Description

Provide defaults for translations of a list of business objects.


Parameters


ipParentObjectIdsinputlongcharComma separated list of object identity values.
icDefaultTranslationinputcharacterDefault for when no translation is found.
tTransStringoutputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/btranslation.p)

empty temp-table tTransString.

/* ================================================================= */
/* Return empty translation values.                                  */
/* ================================================================= */
<Q-40 run LanguageByCodeID (all) (Read) (NoCache)
   (input '', (LngCode)
    input 0, (LngID)
    input ?, (Installed)
    output dataset tqLanguageByCodeID) in BLanguage >

viObjectTotal = num-entries (ipParentObjectIds).

do viObjectCount = 1 to viObjectTotal:
    for each tqLanguageByCodeID where tqLanguageByCodeID.tlLngIsActive on error undo, throw:
        create tTransString.
        assign tTransString.tiParentObject_ID       = integer (entry(viObjectCount,ipParentObjectIds))
               tTransString.tcLngCode               = tqLanguageByCodeID.tcLngCode
               tTransString.tcTranslationStringText = icDefaultTranslation
               tTransString.tc_ParentRowid          = ""
               tTransString.tc_Rowid                = tqLanguageByCodeID.tcLngCode + entry(viObjectCount,ipParentObjectIds)
               tTransString.tc_Status               = "N".
        release tTransString.
    end.
end.