I needed this. I needed this badly. And for once the Oracle Apex forum gave me the answer for my need..
create or replace procedure set_application_status ( p_application in apex_applications.application_id%type , p_status in varchar2 ) is begin if p_status not in ( 'AVAILABLE' , 'AVAILABLE_W_EDIT_LINK', 'DEVELOPER_ONLY' , 'RESTRICTED_ACCESS', 'UNAVAILABLE' , 'UNAVAILABLE_PLSQL' , 'UNAVAILABLE_URL') then raise_application_error(-20000, 'Status '||p_status||' is not supported'); end if; -- for r_i in ( select app.workspace_id , app.application_id from apex_applications app where app.application_id = p_application ) loop wwv_flow_api.set_security_group_id ( p_security_group_id => r_i.workspace_id ); wwv_flow_api.set_flow_status ( p_flow_id => r_i.application_id , p_flow_status => p_status ); commit; end loop; end;