Hello
We are trying to automatically update shop order quantities whenever the quantity (BUY_QTY_DUE
) of a customer order line changes in IFS Apps 8.
Our approach is to define a Custom Event on CustomerOrderLine
and use an Event Action (type: “Execute Online SQL”) to call a PL/SQL procedure which updates the quantities in SHOP_ORD
.
I have prepared the Custom Event, Action, and Procedure as shown in the image below.However, when I test it, it gives an error.



PROCEDURE Update_SO_Qty_From_CO (
order_no_ IN VARCHAR2,
release_no_ IN VARCHAR2,
sequence_no_ IN VARCHAR2,
qty IN NUMBER
)
IS
info_ VARCHAR2(2000);
attr_ VARCHAR2(2000);
objid_ VARCHAR2(2000);
objversion_ VARCHAR2(2000);
BEGIN
FOR rec IN (
SELECT objid, objversion
FROM ifsapp.shop_ord
WHERE (order_no = order_no_ OR order_no = 'YI' || SUBSTR(order_no_, 2))
AND release_no = release_no_
AND sequence_no = sequence_no_
AND state <> 'Closed'
)
LOOP
client_sys.Clear_Attr(attr_);
client_sys.Add_To_Attr('REVISED_QTY_DUE', qty, attr_);
ifsapp.SHOP_ORD_API.MODIFY__(
info_ => info_,
objid_ => rec.objid,
objversion_=> rec.objversion,
attr_ => attr_,
action_ => 'DO'
);
END LOOP;
END Update_SO_Qty_From_CO;