Hi,
following what I learned yesterday on how to add a menu item to the Actions menu, now I'm facing the problem of calling a dialog modal page when the user clicks on that menu item..
I've tried many ways to do it, but all fail with different errors.
The last thing I tried was creating a PL/SQL process on the page and call it from the action (as explained in https://stackoverflow.com/questions/45022407/open-modal-dialog-through-javascript-oracle-apex/52122692#52122692)
As such, I created a PL/SQL process like this one (named "GetUploadUrl"):
declare
v_result varchar2(4000);
begin
v_result := apex_util.prepare_url(apex_application.g_x01);
htp.prn(v_result);
end;
And then, I declared the action as follows:
config.initActions = function( actions ) {
var url = "f?p=" + $v('pFlowId') + ":14:" + $v('pInstance') + "::NO:RP::";
actions.add( {
name: "Upload",
label: "Upload",
icon: "fa fa-upload fa-2x",
action: function( event, focusElement ) {
apex.server.process(
'GetUploadUrl',
{x01: url},
{ success: function (pData) {
console.log(pData);
// Call Modal Dialog Page
apex.navigation.redirect(pData);
},
dataType: "text"
}
);
}
} );
};
When I click on the "Upload" menu item, I get error 404.
Is there a better/easier way to accomplish this ? What am I doing wrong ?
Thank you