Hi all,
Another one thats driving me up the wall.
Apps10
Requirement is to insert sysdate + 14 into target completion date when a user creates an NCR.
First stop was writing a custom event to populate the field.
I’ve made so many code alterations i cant even remember if this is the correct one now so use it as an example.
DECLARE
pragma autonomous_transaction;
INFO_ VARCHAR2(200) := NULL;
OBJID_ VARCHAR2(200) := NULL;
OBJVERSION_ VARCHAR2(200) := NULL;
ATTR_ VARCHAR2(200) := NULL;
ACTION_ VARCHAR2(200) := 'DO';
DATE_ VARCHAR2(200) ;
CURSOR GET_DATE_ IS
select to_char((sysdate + 14),'DD/MM/YYYY')
from dual;
BEGIN
OPEN GET_DATE_;
FETCH GET_DATE_ INTO DATE_;
CLOSE GET_DATE_;
Client_SYS.Clear_Attr(attr_);
Client_SYS.Add_To_Attr('TARGET_COMPLETION_DATE',DATE_, attr_);
NON_CONFORMANCE_REPORT_API.modify__ ( INFO_,OBJID_,OBJVERSION_,ATTR_,'DO');
END;
If i dont add the pragma then i get the mutating trigger etc.
If i add the pragma i get.
So figured to get around this i would write a package and run it as a background job but low and behold the error is returned once again and it fails execution.
I havent used NCR report before so im assuming im missing something important.
Any help would be appreciated!
Thanks