Skip to Main Content

Navigate to Page

Example:

// var p_app_page_id = apex.item('APP_PAGE_ID').getValue() ; ;
// var p_parameter   = apex.item('P'+ p_app_page_id + '_ID').getValue() ;
// var p_url         = "f?p=&APP_ID.:1:&SESSION.::&DEBUG.:1:P1_ID:" + p_parameter + ":" ;   
//
apex.message.showPageSuccess( "Redirecting, please wait ...." );
//
var p_url         = "f?p=&APP_ID.:1:&SESSION.::&DEBUG.:1:::" ;   
fn_page_navigation( p_url ,'' ); 

Code

// Pass parameter to apex.message.showPageSuccess function
// Set a timeout in milliseconds and the hide-message 3 second after it is displayed.
function fn_show_notification( Msg, timeOut){  
        apex.message.showPageSuccess( Msg ); 
           setTimeout(()=>{
           apex.message.hidePageSuccess();
           }, timeOut );
        //
        $('#t_Alert_Success').attr('style','background-color: #000000;');
};

// Dismiss Notifications
function fn_dismissNotification(p_notification_id, p_status ) {
   apex.server.process('DISMISS_NOTIFICATION', {
      x01: p_notification_id ,
      x02: p_status
   }, {
         dataType: 'text',
         success: function (data) {
         apex.event.trigger( "#paneNotifications", "apexrefresh" );
      },
         error: function( jqXHR, textStatus, errorThrown ) {
         // handle error
    }
   });
   };

// Page Navigation No Message, returns checksum for URL
   function fn_page_navigation_no_message ( p_url ) {
      apex.server.process(
         'PAGE_NAVIGATION', // Process or AJAX Callback name
         {
            x01: p_url
         }, // Parameter "x01"
         {
            success: function (pData) { // Success Javascript
            apex.navigation.redirect(pData);
            },
            dataType: "text" // Response type (here: plain text)
         }
      );
      return p_url;
   }; 

// Page Navigation, returns checksum for URL
   function fn_page_navigation( p_url, p_message) {
      apex.server.process(
         'PAGE_NAVIGATION', // Process or AJAX Callback name
         {
            x01: p_url
         }, // Parameter "x01"
         {
            success: function (pData) { // Success Javascript
            apex.message.alert (p_message);
            apex.navigation.redirect(pData);
            },
            dataType: "text" // Response type (here: plain text)
         }
      );
      return p_url;
   }; 

Application Process

Example 1

DECLARE
    v_url VARCHAR2(2000);
BEGIN
    v_url := apex_application.g_x01;
    BEGIN
        v_url := apex_util.prepare_url(
            p_url           => v_url,
            p_checksum_type => 'SESSION'
        );
    EXCEPTION
        WHEN OTHERS THEN
            v_url := sqlerrm;
    END;

    htp.prn(v_url);
END;

Example 2

DECLARE
    l_url      varchar2(2000);
    l_app      number := :APP_ID;
    l_app_page number := :APP_PAGE_ID;
    l_session  number := :APP_SESSION;
    v_url      VARCHAR2(2000); 
BEGIN
   v_url := apex_application.g_x01;
   BEGIN
     IF  v_url IS NOT NULL THEN 
          v_url := apex_util.prepare_url( p_url => v_url, p_checksum_type => 'SESSION');
     ELSE
          v_url := APEX_UTIL.PREPARE_URL( p_url => 'f?p=' || l_app || ':' || l_app_page ||':' || l_session ||'::NO:::', p_checksum_type => 'SESSION');
     END IF ;     
  EXCEPTION
    WHEN OTHERS THEN
     v_url := SQLERRM;
  END;
   htp.prn(v_url);
 END;