I have a custom button in my IG toolbar and I want to go to another page in the application when that button is clicked. I created a page item to store the page URL:
:P3_URL := APEX_UTIL.PREPARE_URL(p_url => 'f?p=' || :APP_ID || ':3:'|| :APP_SESSION ||'::NO:');
And I use it in my custom javascript for my IG:
function(config) {
// Copy defaults
let $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData.toolbarFind("actions4");
// Make up actions to use
config.initActions = function( actions ) {
actions.add( {
name: "new",
label: "New",
action: function() {
apex.navigation.redirect($v('P3_URL'));
}
} );
}
toolbarGroup.controls.push( {
type: "BUTTON",
action: "new",
hot: true
});
// Store the config
config.toolbarData = toolbarData;
// Send it back
return config;
}
It looks fine but once I click the NEW button instead of being take to page 3 I am take to APEX login screen. What am I doing wrong? Is there a better way to accomplish that?