project BLF > include UpdateTransStringForParentID.i
Description
Check input data in t_sTransString and in case when t_sTransString.tiParentObject_ID has a value and t_sTransString.tc_ParentRowid is empty try to assign a value to t_sTransString.tc_ParentRowid.
Use this include at the start of method DataLoadByInput before doing any other processing as method DataLoadByInput itself is supposed to handle t_sTransString data by t_sTransString.tc_ParentRowid.
include parameters
&OBJECTID | field name of primarykey |
&TABLE | database table name |
Internal usage
QadFinancials
include code
for each t_sTransString where
t_sTransString.tiParentObject_ID <> 0 and
(t_sTransString.tc_ParentRowid = "" or
t_sTransString.tc_ParentRowid = ?) on error undo, throw:
find first t_s{&TABLE} where
&IF "{&OBJECTID}" = ""
&THEN
t_s{&TABLE}.{&TABLE}_ID = t_sTransString.tiParentObject_ID no-error.
&ELSE
t_s{&TABLE}.{&OBJECTID} = t_sTransString.tiParentObject_ID no-error.
&ENDIF
if available t_s{&TABLE}
then t_sTransString.tc_ParentRowid = t_s{&TABLE}.tc_Rowid.
end.