In the audit trail new entries are created for an attribute with modified dates but values are blank
STEPS TO REPRODUCE:
Expected Results: The change of values should be audited correctly.
Actual Results: New entries are created for this attribute with modified dates but values are Blank
Release : Any
Component : CLARITY STUDIO
Due to the impact, Engineering has decided no changes will be done for this area of the product.
When the audit is enabled for a field, a Function e gets generated at the Database (DB) level to fetch the old and new values for audit. In this particular case, the function is not generating correctly.
CREATE OR REPLACE FUNCTION clarity.odf_aud_5048360_fct(p_value text)
RETURNS text
LANGUAGE plpgsql
STABLE SECURITY DEFINER
AS $function$
DECLARE
V_RETURN_VALUE TEXT;
BEGIN
select prname into V_RETURN_VALUE
from (select prid, prname from prtask where prprojectid = NULL /* proj_id */ and 1=1) l where prid::text = P_VALUE;
RETURN V_RETURN_VALUE;
END; $function$
;
This should be corrected as below CREATE OR REPLACE FUNCTION clarity.odf_aud_5048360_fct(p_value text)
RETURNS text
LANGUAGE plpgsql
STABLE SECURITY DEFINER
AS $function$
DECLARE
V_RETURN_VALUE TEXT;
BEGIN
select prname into V_RETURN_VALUE
from (select prid, prname from prtask where 1=1) l where prid::text = P_VALUE;
RETURN V_RETURN_VALUE;
END; $function$
;
Note that the name of the function and syntax will be different in each environment based on the database vendor, attribute name, object enabled etc. You have to find out which function it is exactly by checking the Audit Trigger for the attribute code. If you need assistance with this, please contact Broadcom Support.
See also: Lookups master KB for Clarity