Hello All,
I have created a custom event to send an email to users and inform them of the (log id) when a field is updated or deleted in customer screen.
Here is my custom event script :
DECLARE
log_lu_name_ VARCHAR2(1000);
log_id_ NUMBER := 0;
customer_id_ VARCHAR2(1000);
BEGIN
--Set general parameters
customer_id_ := '&OLD:CUSTOMER_ID' ;
log_lu_name_ := 'CustomerInfo';
BEGIN
--Get log ID for history log search
SELECT max(log_id) into log_id_
FROM history_log
WHERE lu_name = log_lu_name_
AND keys like ('%'|| customer_id_||'%')
AND UPPER(history_type) IN ('UPDATE' , 'DELETE') ;
command_sys.Mail(sender_ => 'IFS Applications!',
from_ => '&USER_EMAIL',
to_list_ => '&USER_EMAIL',
cc_list_ => '',
bcc_list_ => '',
subject_ => 'customer : '|| customer_id_ ,
text_ =>'log_id_ = ' || log_id_,
attach_ => '',
rowkey_ => '',
mail_sender_ => '');
END;
END;
and the result of the mail in application message :

When I run the query separatly in sql query tool , I get this result :

The number sent in the mail is always delayed by 1, I don’t understand where is the issue.
Can you please help me figure it out ?
Thank you in advance,
Hanane