Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

How Can I run an update function from PPM application

SOLVED
Go to solution
Highlighted
eata
Regular Collector

How Can I run an update function from PPM application

Hello;
I build a data base function. I want to call the function from PPM application.

FUNCTION upd_rlt_req
( projectno in number )
return varchar2
IS
begin

ppmasya_usr.krsc_utils.update_rlt_req(projectno);


return 'Y';
end upd_rlt_req;


PROCEDURE update_rlt_req
( projectno in number )

IS

upd_1 varchar2(100);
upd_2 varchar2(100);

begin
select
'http://10.100.44.27:8085/itg/project/ViewProject.do?projectId='||pm.project_id into upd_1
from
ppmasya_usr.pm_projects pm
where
pm.pfm_request_id=projectno;

select
pm.project_name||' - '||pm.display_status into upd_2
from
ppmasya_usr.pm_projects pm
where
pm.pfm_request_id=projectno;

update ppmasya_usr.kcrt_request_details krd
set
krd.parameter9=upd_1, krd.visible_parameter9= upd_2
where krd.request_id in (select ent2.visible_parameter6 from ppmasya_usr.kcrt_table_entries ent2
where ent2.request_id=projectno);

commit;



end update_rlt_req;

I can run function from SQL navigator
declare
result varchar(200);
begin

result := ppmasya_usr.krsc_utils.upd_rlt_req(37903);
return result;
end;

How can I run the same function from PPM rule on apply on transition.

I can not run as
select
ppmasya_usr.krsc_utils.upd_rlt_req([REQ.REQUEST_ID])
because there is an update operation.

1 REPLY
Erik Cole
Honored Contributor
Solution

Re: How Can I run an update function from PPM application

Add the directive PRAGMA AUTONOMOUS_TRANSACTION; to the top of your function. This will allow the update operation from within the rule select statement.

//Add this to "OnDomLoad" event