Solved

Approval Routing - Step Approved

  • 23 December 2020
  • 1 reply
  • 475 views

Userlevel 5
Badge +14
  • Hero (Customer)
  • 275 replies

Hi,

 

I am trying to add history to Customer Order when the step approved. The problem is I can't take information from approval routing. History API new is working. I want to add a description of the step to history. Is there a way?

 

DECLARE
order_no_ VARCHAR(32000) := '&KEY01';
info_ VARCHAR2(32000) := NULL;
objid_ VARCHAR2(32000) := NULL;
objversion_ VARCHAR2(32000) := NULL;
attr_ VARCHAR2(32000) := '';
mesaj_ VARCHAR2(1000);
desc_ VARCHAR2(1000);
BEGIN
SELECT description
INTO desc_
FROM approval_routing
WHERE key_ref = ifsapp.client_sys.get_key_reference('CustomerOrderLine', 'ORDER_NO', order_no_)
AND step_no =
ifsapp.approval_routing_api.get_current_step('CustomerOrder', (ifsapp.client_sys.get_key_reference('CustomerOrderLine', 'ORDER_NO', order_no_)));
mesaj_ := desc_ || ' verdi!';
FOR rec IN (SELECT * FROM customer_order WHERE order_no = order_no_) LOOP
BEGIN
attr_ := 'ORDER_NO' || chr(31) || rec.order_no || chr(30) || 'DATE_ENTERED' || chr(31) || to_char(SYSDATE, 'YYYY-MM-DD-HH24.MI.SS') || chr(30) ||
'USERID' || chr(31) || ifsapp.fnd_session_api.get_fnd_user() || chr(30) || 'MESSAGE_TEXT' || chr(31) || mesaj_ || chr(30) || 'HIST_STATE' ||
chr(31) || rec.objstate || chr(30);
ifsapp.customer_order_history_api.new__(info_, objid_, objversion_, attr_, 'DO');
END;
END LOOP;
END;

 

icon

Best answer by hhy38 23 December 2020, 13:41

View original

This topic has been closed for comments

1 reply

Userlevel 5
Badge +14

I solve the problem. I am using get_current_step because of that. It gives an error while last approve. I changed it to Get_Previous_App_Step, It works normally.