Hi,
I believe to be close to the solution, but as newbie someting is probably missing:
I have a custom logical unit: t_g_t_t_b_f_clv and i want to define the value contained in the field CF$_ID1 (it will be a custom ID number) upon creation of new rows.
So I made an event that triggers upon insertion:
Then i use this code to fetch the right ObjId and Objversion + AUTONOMOUS_TRANSACTION to avoid mutating error:
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
info_ varchar2(300);
objid_ varchar2(300);
objversion_ varchar2(300);
attr_ varchar2(1000);
id1_ number;
begin
SELECT OBJKEY, OBJVERSION into objid_, objversion_
FROM IFSAPP.t_g_t_t_b_f_clv
WHERE IFSAPP.t_g_t_t_b_f_clv.OBJKEY= '&OLD:ROWKEY';
id1_ := 258;
Client_SYS.clear_attr(attr_);
Client_SYS.add_to_attr('CF$_ID1',id1_, attr_);
ifsapp.T_G_T_T_B_F_CLP.Modify__(info_, objid_, objversion_, attr_, 'DO');
commit;
end;
but it does not seem to get the value… If I use the same code based on a previous RowKey entered manually, it works…
I tried to trigger Before and After, with NEW and OLD values, but the problem remains the same…
Any idea ?? Thanks.