Solved

Too many declarations of 'Deferred_Call' match this call

  • 21 March 2021
  • 3 replies
  • 606 views

Userlevel 4
Badge +9

I am getting this error on a custom event when I try to post a background job using a Deferred Call.

“Too many declarations of 'Deferred_Call' match this call”

The Action Details of the event are below

 

DECLARE



rowkey_attr_ VARCHAR2(32000) := '&NEW:ROWKEY';
wo_no_attr_ VARCHAR2(32000) := NULL;
app_amt_attr_ varchar2(2000):='&NEW:CF$_APPLICATION_AMOUNT';
invoice_attr_ varchar2(2000):='&NEW:CF$_INVOICE_NO';
po_attr_ varchar2(2000):='&NEW:CF$_PO_NUMBER';
params_ VARCHAR2(32000) ;
job_id_ VARCHAR2(32000) ;
BEGIN


SELECT WO_NO INTO wo_no_attr_ FROM ACTIVE_SEPARATE_OVERVIEW WHERE OBJKEY=rowkey_attr_ ;

client_sys.Clear_Attr(params_);
client_sys.Add_To_Attr('wo_no_', wo_no_attr_ , params_);
client_sys.Add_To_Attr('app_amt', app_amt_attr_ , params_);
client_sys.Add_To_Attr('inv_no', invoice_attr_ , params_);
client_sys.Add_To_Attr('po_no', po_attr_ , params_);


transaction_sys.Deferred_Call(job_id_, 'EPS_TECH_UTIL_API.UPDATE_ACTIVE_WORK_ORDER_BKUP','ATTRIBUTE', params_,'Update the Work Order',sysdate,'FALSE',2);


END;

The procedure I am calling is below

PROCEDURE UPDATE_ACTIVE_WORK_ORDER_BKUP ( params_ varchar2)

is

thewo VARCHAR2(32000) ;

begin
thewo:= client_sys.Get_Item_Value('wo_no_', params_);

INSERT INTO TEST2 VALUES ('wo_no_ '|| thewo);
COMMIT;
end;

What I am executing in the procedure is just for testing purposes, the finished procedure will look different. I don’t think the issue is the procedure the deferred call is calling,  I think it is in the custom event the problem is.  I have tried removing some of the parameters, renaming variables ,renaming the procedure, putting the procedure in a different package but nothing works. 

I cannot make and deferred calls in custom events, I get this every time. Is there a limit on the number of times deferred call can be used in custom events?

I have lots of other custom events that use it and they all execute fine.

icon

Best answer by EntNadeeL 22 March 2021, 05:34

View original

This topic has been closed for comments

3 replies

Userlevel 4
Badge +9

Nadeesha’s answer works correctly, many thanks for her help.

Userlevel 7
Badge +16

I am getting this error on a custom event when I try to post a background job using a Deferred Call.

“Too many declarations of 'Deferred_Call' match this call”

The Action Details of the event are below

 

DECLARE



rowkey_attr_ VARCHAR2(32000) := '&NEW:ROWKEY';
wo_no_attr_ VARCHAR2(32000) := NULL;
app_amt_attr_ varchar2(2000):='&NEW:CF$_APPLICATION_AMOUNT';
invoice_attr_ varchar2(2000):='&NEW:CF$_INVOICE_NO';
po_attr_ varchar2(2000):='&NEW:CF$_PO_NUMBER';
params_ VARCHAR2(32000) ;
job_id_ VARCHAR2(32000) ;
BEGIN


SELECT WO_NO INTO wo_no_attr_ FROM ACTIVE_SEPARATE_OVERVIEW WHERE OBJKEY=rowkey_attr_ ;

client_sys.Clear_Attr(params_);
client_sys.Add_To_Attr('wo_no_', wo_no_attr_ , params_);
client_sys.Add_To_Attr('app_amt', app_amt_attr_ , params_);
client_sys.Add_To_Attr('inv_no', invoice_attr_ , params_);
client_sys.Add_To_Attr('po_no', po_attr_ , params_);


transaction_sys.Deferred_Call(job_id_, 'EPS_TECH_UTIL_API.UPDATE_ACTIVE_WORK_ORDER_BKUP','ATTRIBUTE', params_,'Update the Work Order',sysdate,'FALSE',2);


END;

The procedure I am calling is below

PROCEDURE UPDATE_ACTIVE_WORK_ORDER_BKUP ( params_ varchar2)

is

thewo VARCHAR2(32000) ;

begin
thewo:= client_sys.Get_Item_Value('wo_no_', params_);

INSERT INTO TEST2 VALUES ('wo_no_ '|| thewo);
COMMIT;
end;

What I am executing in the procedure is just for testing purposes, the finished procedure will look different. I don’t think the issue is the procedure the deferred call is calling,  I think it is in the custom event the problem is.  I have tried removing some of the parameters, renaming variables ,renaming the procedure, putting the procedure in a different package but nothing works. 

I cannot make and deferred calls in custom events, I get this every time. Is there a limit on the number of times deferred call can be used in custom events?

I have lots of other custom events that use it and they all execute fine.

Hi John,

 

You can follow below format in the event and it will post a background job everytime it triggers. It works like that. 

 

DECLARE 
    attr_         VARCHAR2(32000);
    sql_msg_      VARCHAR2(32000);
    stmt_         VARCHAR2(32000);
    job_id_       NUMBER;
    error_text_   VARCHAR2(2000);       
BEGIN
stmt_ := '

DECLARE                                  
BEGIN
     Write whatever the code you want here. 
END;
';
sql_msg_ := Message_SYS.Construct('UPD');
   Message_SYS.Add_Attribute(sql_msg_, 'SQL', stmt_);
   Client_SYS.Clear_Attr(attr_);
   Client_SYS.Add_To_Attr('SQL_DATA_', sql_msg_, attr_);
   Client_SYS.Add_To_Attr('MSG_', '', attr_);
   Transaction_SYS.Deferred_Call(job_id_,'Fnd_Event_Action_API.Action_Executeonlinesql','PARAMETER',attr_,'Set null Customer Address');    
END; 

 

This is awesome! It’s a problem we often faced with deferred calls. 

Thanks for sharing @EntNadeeL 

Userlevel 5
Badge +9

I am getting this error on a custom event when I try to post a background job using a Deferred Call.

“Too many declarations of 'Deferred_Call' match this call”

The Action Details of the event are below

 

DECLARE



rowkey_attr_ VARCHAR2(32000) := '&NEW:ROWKEY';
wo_no_attr_ VARCHAR2(32000) := NULL;
app_amt_attr_ varchar2(2000):='&NEW:CF$_APPLICATION_AMOUNT';
invoice_attr_ varchar2(2000):='&NEW:CF$_INVOICE_NO';
po_attr_ varchar2(2000):='&NEW:CF$_PO_NUMBER';
params_ VARCHAR2(32000) ;
job_id_ VARCHAR2(32000) ;
BEGIN


SELECT WO_NO INTO wo_no_attr_ FROM ACTIVE_SEPARATE_OVERVIEW WHERE OBJKEY=rowkey_attr_ ;

client_sys.Clear_Attr(params_);
client_sys.Add_To_Attr('wo_no_', wo_no_attr_ , params_);
client_sys.Add_To_Attr('app_amt', app_amt_attr_ , params_);
client_sys.Add_To_Attr('inv_no', invoice_attr_ , params_);
client_sys.Add_To_Attr('po_no', po_attr_ , params_);


transaction_sys.Deferred_Call(job_id_, 'EPS_TECH_UTIL_API.UPDATE_ACTIVE_WORK_ORDER_BKUP','ATTRIBUTE', params_,'Update the Work Order',sysdate,'FALSE',2);


END;

The procedure I am calling is below

PROCEDURE UPDATE_ACTIVE_WORK_ORDER_BKUP ( params_ varchar2)

is

thewo VARCHAR2(32000) ;

begin
thewo:= client_sys.Get_Item_Value('wo_no_', params_);

INSERT INTO TEST2 VALUES ('wo_no_ '|| thewo);
COMMIT;
end;

What I am executing in the procedure is just for testing purposes, the finished procedure will look different. I don’t think the issue is the procedure the deferred call is calling,  I think it is in the custom event the problem is.  I have tried removing some of the parameters, renaming variables ,renaming the procedure, putting the procedure in a different package but nothing works. 

I cannot make and deferred calls in custom events, I get this every time. Is there a limit on the number of times deferred call can be used in custom events?

I have lots of other custom events that use it and they all execute fine.

Hi John,

 

You can follow below format in the event and it will post a background job everytime it triggers. It works like that. 

 

DECLARE 
    attr_         VARCHAR2(32000);
    sql_msg_      VARCHAR2(32000);
    stmt_         VARCHAR2(32000);
    job_id_       NUMBER;
    error_text_   VARCHAR2(2000);       
BEGIN
stmt_ := '

DECLARE                                  
BEGIN
     Write whatever the code you want here. 
END;
';
sql_msg_ := Message_SYS.Construct('UPD');
   Message_SYS.Add_Attribute(sql_msg_, 'SQL', stmt_);
   Client_SYS.Clear_Attr(attr_);
   Client_SYS.Add_To_Attr('SQL_DATA_', sql_msg_, attr_);
   Client_SYS.Add_To_Attr('MSG_', '', attr_);
   Transaction_SYS.Deferred_Call(job_id_,'Fnd_Event_Action_API.Action_Executeonlinesql','PARAMETER',attr_,'Set null Customer Address');    
END;