Powered By Blogger

শনিবার, ২৬ এপ্রিল, ২০২৫

Finding IP Address in apex

 To Find IP Address of the User who login in Apex


This is the very import as a developer prospective, normally we are tracking who user’s login name, date and time for monitoring purpose.

But I saw so many scenarios, some users are sharing his credentials, which is totally wrong. So by using below code, we can track the Ip Address of The user. So, any issues we can caught him.

It’s very important for user for those report, which are very important as company prospective.  

It’s available under owa_util package and another query available in Sys_context.

Query

 SELECT OWA_UTIL.GET_CGI_ENV('REMOTE_ADDR') IP_ADDESS_APP_USER FROM DUAL;

SELECT SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15) IP_ADDESS_APP_USER FROM DUAL;


we can write the code Process > After Header


BEGIN

   INSERT INTO    xxxxcomany_apex_report_history (

                                         sa_username,

                                         sa_report_name,

                                         sa_page_id,

                                         sa_viewed_date,

                                         ip_address)

      (SELECT   

                :APP_USER,

                (SELECT   s.text

                   FROM   sify_procure_menu_ins s

                  WHERE   1 = 1 AND s.page_id = :APP_PAGE_ID)

                   text,

                :APP_PAGE_ID,

                SYSDATE,

    (SELECT OWA_UTIL.GET_CGI_ENV('REMOTE_ADDR') IP_ADDESS_APP_USER FROM DUAL) AS IP_ADDRESS


         FROM   DUAL);

END;


মঙ্গলবার, ১৫ এপ্রিল, ২০২৫

Finding Latitude and Longitude in oracle apex

 STEP 1:- CREATE A REGION WITH TWO ITEMS ONE IS LAT AND LONG


STEP 2:- THIS CODE PASTE INTO YOUR REGION STATIC CONTENT



<a id="geoError"></a>


STEP 3:- GO TO YOUR PAGE SECTION Function and Global Variable Declaration PASTE THIS CODE




function getLocation() {

var x=document.getElementById("geoError");

if (navigator.geolocation) {

navigator.geolocation.getCurrentPosition(

 function setPosition(position) {

// x.innerHTML="setPosition:"+position.coords.latitude;

 $s("P1_LATITUDE" , position.coords.latitude);

$s("P1_LONGITUDE", position.coords.longitude);

 }

,function (error)

{

switch(error.code) 

{

case error.PERMISSION_DENIED:

x.innerHTML="User denied the request for Geolocation."

break;

case error.POSITION_UNAVAILABLE:

x.innerHTML="Location information is unavailable."

break;

case error.TIMEOUT:

x.innerHTML="The request to get user location timed out."

break;

case error.UNKNOWN_ERROR:

x.innerHTML="An unknown error occurred."

break;

}

}    

,{timeout:10000});

x.innerHTML="Success";

}

else

x.innerHTML="Geolocation is not supported by this browser.";

}




STEP 4 :- ON PAGE LOAD EXECUTE JAVASCRIPT CODE


getLocation();

Row-level “Add” icon using a virtual column (APEX-safe)

1️⃣ Enable Insert in the Interactive Grid IG → Attributes Edit → Allowed Add Row → Yes 2️⃣ Add a New Column (Icon column) Column...