Hello Community,
I have an apex application.
There is a javascript code that calls an Ajax callback that runs a process called AjaxTest :
Javascript : (When the Ajax call is successful, it shows the result through alert(pData). Very simple)
apex.server.process( 'AjaxTest', // Process or AJAX Callback name {x01: accessToken}, // Parameter "x01" { success: function (pData) { // Success Javascript alert(pData); // Show the result }, dataType: "text" // Response type (here: plain text) } );
The PL/SQL process named AjaxTest is
declare Token varchar2(32000); Temp number; Begin Token := apex_application.g_x01; Temp := 1; -- Here there is a call to a packaged function to perform some tests and return the result if Temp = 1 then Wwv_Flow_Custom_Auth_Std.Post_Login(p_uname => Email , p_session_id => v('APP_SESSION')); end if ; htp.p('Hi !'); end;
The code is expected to perform some tests on the database and authenticate the user.
I kept only the things that illustrate my problem in the previous code.
The code works and authenticates the user. However, I can't get the PL/SQL result from JavaScript.
When I remove the authentication row Wwv_Flow_Custom_Auth_Std.Post_Login, I'm able to get Ajax result from Javascript and "alert(pData)" works (I get "Hi !"). But when I keep this line, alert(pData) shows the HTML of the entire page which is not what I need (see picture below).
I need to get the exact result of the Ajax callback.
Anyone has an idea please ?
Thanks.
