Hello,
I have the following code that works with no issues in Apps8, however in Apps 10 gives a mutating trigger on VOUCHER_TAB. How can I overcome this please ?
Declare
account_ number;
count_ number;
BEGIN
select count(*),LISTAGG(account, '; ')WITHIN GROUP (ORDER BY account) into count_, account_
FROM ifsapp.voucher_row
where company = '&NEW:COMPANY'
and accounting_year = '&NEW:ACCOUNTING_YEAR'
and voucher_type = '&NEW:VOUCHER_TYPE'
and voucher_no = '&NEW:VOUCHER_NO'
and (substr(account, 0, 4) = '9000' or account = '13009000')
and '&NEW:APPROVED_BY_USERID' not in
(select pia.user_id from IFSAPP.company_pers_assign cpa
left outer join ifsapp.PERSON_INFO_ALL pia
on cpa.emp_no = pia.person_id
where cpa.valid_to >= sysdate
and cpa.pos_code in
(select cpp.pos_code from COMPANY_POS_PROPERTY_ALL cpp where cpp.property_code = 'VOUCH_APP' and cpp.PROPERTY_VALUE = 'TRUE'))
and '&NEW:APPROVED_BY_USERID' <> 'IFSAPP';
if
count_ > 0
then
error_sys.Record_General('Voucher','NOT AUTHORISED, status "Approved" is not permitted on vouchers using accounts like ' || account_);
else null;
end if;
END;