Hello everyone,
I have created a persistant custom field called APPROBATION_USER_ID_STEP_1 in the PaymentPlan entity, and i want to modify its value in my custom event, so i have used the CF_Modify__ method that belongs to the custom field package PAYMENT_PLAN_CFP, but the custom field is not updated.
Could you please provide me some help ? This is my code :
DECLARE ATTR_ VARCHAR2(4000);
STMT_ VARCHAR2(4000);
SQL_MSG_ VARCHAR2(4000);
BEGIN
STMT_ := q'>
DECLARE
objid_ VARCHAR2(4000);
objv_ VARCHAR2(4000);
info_ VARCHAR2(4000);
onHoldReason_ VARCHAR2(4000);
onHoldReasonId_ VARCHAR2(4000);
managerProject_ VARCHAR2(4000);
PROJ_ID VARCHAR(1000);
PROJ_MNG VARCHAR(1000);
INV_COMP VARCHAR2(1000);
invoiceid_ NUMBER(20);
site_ VARCHAR2(20);
installementid_ NUMBER;
ATTR_ VARCHAR2(4000);
attr_cf_ VARCHAR2(4000);
ERROR_MSG VARCHAR2(4000);
BEGIN
SELECT INVOICE_ID, COMPANY,INSTALLMENT_ID, OBJID as objid
INTO invoiceid_,site_,installementid_, objid_
FROM PAYMENT_PLAN_AUTH_QRY_CFV
WHERE INVOICE_ID = &NEW:INVOICE_ID AND COMPANY = '&NEW:COMPANY' AND INSTALLMENT_ID = &NEW:INSTALLMENT_ID;
CLIENT_SYS.CLEAR_ATTR(ATTR_);
CLIENT_SYS.ADD_TO_ATTR('ON_HOLD_REASON', onHoldReason_ , ATTR_);
CLIENT_SYS.ADD_TO_ATTR('ON_HOLD', 'True' , ATTR_);
PAYMENT_PLAN_API.Modify__(info_, objid_, objv_, ATTR_, 'DO');
-- UPDATE THE CUSTOM FIELD :
CLIENT_SYS.CLEAR_ATTR(ATTR_);
CLIENT_SYS.CLEAR_ATTR(attr_cf_);
CLIENT_SYS.ADD_TO_ATTR('CF$_APPROBATION_USER_ID_STEP_1', onHoldReason_ , attr_cf_);
PAYMENT_PLAN_CFP.CF_Modify__(info_, objid_, attr_cf_, ATTR_, 'DO');
END;]';
SQL_MSG_ := MESSAGE_SYS.CONSTRUCT('UPDATECOLINE');
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('Fnd_Event_Action_API.Action_Executeonlinesql','PARAMETER',
ATTR_,LANGUAGE_SYS.TRANSLATE_CONSTANT(
'Event',
'Authorize Invoice for payment',
NULL,
NULL
)
);
END;