Search This Blog

Tuesday, April 14, 2020

Redirect One Server App To Another Server App Without Second Time Login In Oracle Apex


1. Create Report With URL Generation                Source Server 

 SELECT   'http://URL/f?p=' 

          || '101'
          || ':'
          || 2
          || ':'
          || :APP_SESSION
          || '::::P2_USER,P2_SESSION_ID,P2_LOG_ID,P2_BRANCH_CODE:'
          || 'admin' -- :app_user (this user must be common between server)
          || ','
          || :APP_SESSION
          || ','
          || :AI_LOG_ID  -- This one is just for passing value
          || ','
          || :AI_BRANCH_CODE CARD_LINK,  --This one is just for passing value
          '48' CARD_TITLE,
          'Go Another Server App' CARD_TEXT
     FROM DUAL
 
2. Create A Public page with like below items               Destination Server           
     
P2_USER,P2_SESSION_ID,P2_LOG_ID,P2_BRANCH_CODE:'

3. Create a Process on load before header for authentication


begin
apex_authentication.login (p_username   =>:P2_USER,
                           p_password   => '123');
                                    
Exception
    when others then raise_application_error(-20001, sqlerrm);
End;

4. Create a Dynamic Action On Load with Submit event


5. Create a branch and select the page where you want to redirect.


6. Create Custom Authentication with boolean return function like below


function my_authentication (

    p_username in varchar2,
    p_password in varchar2 )
    return boolean
is
    
begin
    Return true;
exception
    when NO_DATA_FOUND then return false;
end;

Don't Forget to Copy past the function to Authentication Function Name

Monday, April 13, 2020

Universal Unique Identifier (UUID)


Using SYS_GUID()

UUID is the SYS_GUID() function provided by Oracle to produce a Globally Unique Identifier, their equivalent of a UUID.

SELECT SYS_GUID() FROM dual;

SYS_GUID()
--------------------------------
E7FBCFDD32B4B95BE0301A0A010AF268

Only Number In Oracle Apex Test Field



$(".allow-decimal").keypress(function (e) {
    if(e.which == 46){
        if($(this).val().indexOf('.') != -1) {
            return false;
        }
    }
    if (e.which != 8 && e.which != 0 && e.which != 46 && (e.which < 48 || e.which > 57)) {
        return false;
    }
});


allow-decimal

onfocusout="this.value=Number(this.value).toFixed(4)"

Sunday, April 12, 2020

Remove Spinners From Oracle Apex

 To Remove Spinner From Oracle Apex Just Use This CSS.
Page Properties  ->  CSS  -> Inline

.u-Processing {
   display:none !important;
}

Friday, April 10, 2020

Get Visitor IP


Begin
    Insert Into Visitor_info (
        user_id,
        login_datetime,
        ip_address
    ) Values (
        :app_user,
        Sysdate,
        owa_util.get_cgi_env('X-FORWARDED-FOR')
    );

Exception
    When Others Then
        Null;
End;

Restrict File Upload by File Type in Oracle Apex

If you want to restrict file upload by file type/extension/format you can follow the below steps.  Goto File Browser Item --> Advanced --...