project BLF > include UpdateTransString.i
Description
Generic code that must be included into method DataLoadByInput for every table in the class dataset that has at least one translatable column.
include parameters
&OBJECTID | field name of primarykey |
&TABLE | database table name |
Internal usage
BLF
QadFinancials
include code
for each t_sTransString where t_sTransString.tc_ParentRowid = t_s{&TABLE}.tc_Rowid on error undo, throw:
&IF "{&OBJECTID}" = ""
&THEN
t_sTransString.tiParentObject_ID = t{&TABLE}.{&TABLE}_ID.
find first tTransString where
tTransString.tiParentObject_ID = t{&TABLE}.{&TABLE}_ID and
&ELSE
t_sTransString.tiParentObject_ID = t{&TABLE}.{&OBJECTID}.
find first tTransString where
tTransString.tiParentObject_ID = t{&TABLE}.{&OBJECTID} and
&ENDIF
tTransString.tcLngCode = t_sTransString.tcLngCode
no-error.
if available tTransString
then if t_sTransString.tcTranslationStringText = ""
and tTransString.tc_Status = "N"
then do:
delete t_sTransString.
delete tTransString.
end.
else assign t_sTransString.tc_ParentRowid = tTransString.tc_ParentRowid
t_sTransString.tc_Rowid = tTransString.tc_Rowid
t_sTransString.tc_Status = tTransString.tc_Status.
else if t_sTransString.tc_Status = "D"
or t_sTransString.tcTranslationStringText = ""
then delete t_sTransString.
else assign t_sTransString.tc_Status = "N".
end.