Hi,
When manually updating a custom field (e.g., triggered by an event), it is common to assume that the existence of a record for the given ROWKEY must be verified before updating. In practice, this check is fully managed by the framework.
To perform the update, you just need to pass the objid_ and the two attribute strings. This procedure is consistent for both CF_New__ and CF_Modify__.
DECLARE
objid_ VARCHAR2(100);
rowkey_ VARCHAR2(100);
info_ VARCHAR2(32000);
attr_cf_ VARCHAR2(32000);
attr_ VARCHAR2(32000);
max_date_ DATE;
CURSOR get_objid(key_ VARCHAR2) IS
SELECT objid
FROM ifsapp.customer_order_line
WHERE objkey = key_;
BEGIN
rowkey_ := '4AAA4D5010C186EFE063E57FF20AF8C4';
--get the objid from the rowkey
OPEN get_objid (rowkey_);
FETCH get_objid INTO objid_;
CLOSE get_objid;
--clear attribute strings
ifsapp.Client_SYS.Clear_Attr(attr_cf_);
ifsapp.Client_SYS.Clear_Attr(attr_);
--assign the values to be inserted or updated
max_date_ := SYSDATE;
ifsapp.Client_SYS.Add_To_Attr('CF$_MAX_DATE', max_date_, attr_cf_);
--1. to insert
ifsapp.Customer_Order_Line_Cfp.Cf_New__(info_ , objid_ ,attr_cf_,attr_,'DO');
--2. to update
ifsapp.Customer_Order_Line_Cfp.Cf_Modify__(info_ , objid_ ,attr_cf_,attr_,'DO');
END;
Hope this helps.
Best Regards,
Nisansala