Sunday, 13 November 2016

APEX 5 - CSS export

Theme roller changes export

Exporting your CSS customization

Something I wanted to write down since I returned from KScope in Chicago and presenting at AUSOUG Connect 2016 just made me realized this will be useful to other as well.

Apex 5 came with this greatly looking Universal theme and Theme roller functionality. 

But did you ever want to export theme customization you made on your application to any other app?

These are steps you need to take
  1. In your customized application open Theme Roller
  2. Make customization (if not already there)
  3. Open browser developer Console
  4. Execute apex.utr.config()
  5. On left hand side a result similar to apex.utr.config({"customCSS":"","vars":{"@g_Accent-BG":"#25cf7d"}}); will be shown.
  6. Copy code shown on the left starting with apex.utr.config
  7. Open and run your application (where you want to copy the theme)
  8. Open Theme Roller; This is important otherwise you get apex.utr.config is not a function error in your console
  9. Open browser developer console
  10. Paste copied text and Run
  11. You will notice changes on you application
That is all. All needed now is for you to save it using Save As button.

As far as I am aware this is currently only way to do this. There is no out of the box functionality/supported way of doing the same. 

Hope this will help. Again thanks Roel for sharing. 
Cheers, 
SLino

Tuesday, 8 November 2016

APEX User details

NVL(v('APP_USER'), user) alternative

Fresh from the factory - AUSOUG Connect2016

One of the things that I will take home from AUSOUG Connect2016 in Perth is nice little tip from Scott and his team

If you ever wanted to pick up on a user identity using the application within your triggers most likely you opted for:
NVL(v('APP_USER'), user) 

For the future you might be using:
coalesce ( sys_context('APEX$SESSION', 'app_user')
         , regexp_substr(sys_context('userenv',   'client_identifier') ,'^[^:]*') --for remote users
         , sys_context('userenv', 'session_user')


Reason being it works faster then NVL combination especially on large scale data. 

When working in Oracle 12c this can even became part of you table script:

....
, created_by varchar2(40) default
  coalesce ( sys_context('APEX$SESSION', 'app_user')
         , regexp_substr(sys_context('userenv',   'client_identifier') ,'^[^:]*')
         , sys_context('userenv', 'session_user')
 not null
......
So there will be no need to do this in your trigger body anymore.

Thanks again for sharing.

 
Cheers,
Lino

Wednesday, 12 October 2016

OTN Appreciation Day : PL/SQL

Tim Hall's initiative

Showing some appreciation for ORACLE features we all use!!!!!

What a great idea by Tim to find some time to think about what would be the thing that I could point out as most favorite feature of Oracle
  
No matter how easy it seems selecting only one has proven hard for me.

I would have to go with PL/SQL, that is where it all starts. 

In 2006 this was my first real word programming tool and 10 years later I would not change it for anything else. This then led me to Oracle APEX and I could not be any happier. 

Thanks ORACLE.

Cheers,
Lino