Hello ,
I need to prevent the creation of a new customer invoice if the customer is not approved .
I tried to create a custom event to control that , But it does’t stop the creation of a new customer invoice .
I applied the custom event on CustomerOrderInvHead (LU) and INVOICE_TAB and here is the script of my event action :
DECLARE
lu_name_ VARCHAR2(1000) ;
key_ref_ VARCHAR2(32000) ;
result_ VARCHAR2(32000) ;
--approval_status_ VARCHAR2(1000) ;
BEGIN
lu_name_ := 'CustomerOrderInvHead';
key_ref_ := 'CUSTOMER_ID=&NEW:IDENTITY^' ;
result_ := approval_routing_api.is_approved(lu_name_,key_ref_);
IF (result_ = 'FALSE') THEN
Error_SYS.Record_General(lu_name_, 'APPROVAL_ROUTING: This invoice cannot be created. The customer is not approved') ;
end if;
END;
Does anyone have an idea what could be the problem ?
Thank you ,
Hanane