Filter Hooks
If a field that does not exist in all feature packs is used in a filter hook, you can deal with that as follows.
Library function:
function extern boolean tcbod.dll0001.table.field.exists(
const string i.table.field )
{
DllUsage
Expl This function checks if a specified table field exists.
Input i.table.field: table field code including table, e.g. "ppmmm999.abcd"
Output n.a.
Return true - table field exists.
false - table field does not exist.
EndDllusage
long return.value
long dummy.position.field.in.row
long dummy.size.field
long dummy.depth.field
long dummy.type.field
long dummy.flags
string dummy.domain.name
string dummy.default.value
return.value = rdi.column(
i.table.field,
dummy.domain.name,
dummy.position.field.in.row,
dummy.size.field,
dummy.depth.field,
dummy.type.field,
dummy.flags,
dummy.default.value )
return(return.value = 0)
}
Define in include hook:
#define PPMMM999_FLD2 "ppmmm999.fld2"
| define is needed for filter hook, because otherwise the table code is replaced if
an alias is used
Filter hook
o.hookFilter = "ppmmm999.fld1 >= 0"
if tcbod.dll0001.table.field.exists(PPMMM999_FLD2) then
| field fld2 may not exist in all feature packs, so we must check this
o.hookFilter = o.hookFilter & " and ppmmm999.fld2 = tcyesno.no"
endif
return(0)