An attribute based on a parameterized lookup is not properly being audited. The entry for the insert and/or update operations of the attribute is being created on the Audit Trail tables, but the values are blank for the OLD and NEW values of the attribute.
Expected Results: Entries are created for both Aggregator and Program attributes on the Audit Trail. The Old Value and New Value are logged on those entries
Actual Results: Entries are created for both Aggregator and Program attributes on the Audit Trail. The Old Value and New Value are blank for the attribute Program
All Supported Releases
This issue is caused by the where condition (AND (@WHERE:PARAM:USER_DEF:STRING:[email protected] = MAP.z_agregador). This line is added to filter the program based on aggregation value, which is a scalar function. As a scalar function will not have the context, the where clause gets converted as NULL = MAP.z_aggregation and fails to return audit data for the field
Update the query so the scalar function is outside the filter so that it gets ignored in scalar function creation.
Example:
(AND (@WHERE:PARAM:USER_DEF:STRING:[email protected] = MAP.z_agregador)
AND @[email protected]
@BROWSE-ONLY:
Corrected query:
SELECT DISTINCT
@SELECT:LOOKUP.LOOKUP_CODE:[email protected],
@SELECT:LOOKUP.NAME:[email protected],
@SELECT:LOOKUP.SORT_ORDER:[email protected],
@SELECT:LOOKUP.LAST_UPDATED_DATE:[email protected],
@SELECT:LANG.LANGUAGE_CODE:[email protected],
@SELECT:LANG.ID:[email protected]
FROM odf_ca_z_map_iniciativas MAP, CMN_LOOKUPS_V LOOKUP, CMN_LANGUAGES LANG
WHERE MAP.z_programa = LOOKUP.LOOKUP_CODE
AND LOOKUP.LANGUAGE_CODE = LANG.LANGUAGE_CODE
AND LOOKUP.LOOKUP_TYPE = 'Z_LCKP_PROGRAMA'
AND LOOKUP.LANGUAGE_CODE = @WHERE:PARAM:[email protected]
AND @[email protected]
@BROWSE-ONLY:
AND (@WHERE:PARAM:USER_DEF:STRING:[email protected] = MAP.z_agregador)
AND LOOKUP.IS_ACTIVE=1
:[email protected]