Monday 2 October 2023

ORACLE APEX Application item with global scope

 

ORACLE APEX Application item with global scope

Sharing the value between two or more applications - How to?

Simple use case - we have two apps that share authentications and now we want to pass the application items value between these two. 

For a long time now APEX application definition had this feature where we can declare global application items. 

But what does it actually mean and how do we actually do this when there are more apps in place?!! 

Create an app, add an application item to it with a global scope. Have some way of setting this item to a certain value. So far so good. 

Okay now we can create a link to an app #2 where we will try to read this value out. 

Of course first thing we would need to do, is we need to set and align both Authentication Schemes to share their cookies. This way we do not get ask to re-login. We all knew this so far.

In application #2 create a region and simply reference globally set application item from an app 1 using substitution variable syntax. In my example this would be &APP_GLOBAL_ITEM. 


But if you run this.... nothing would happen. Or better said you would not get the expected value back. Question is why? 

In order to get this going the point is that you have to have the same application item created in both of these apps. Else it could leave you wondering what you have done wrong. 

Thanks Mark G. for bringing this to my attention and here is a reference to existing post with the same topic.

https://stackoverflow.com/questions/58065558/oracle-apex-how-to-access-application-items-with-global-scope-in-multiple-applic

Happy APEXing,

SLino

No comments:

Post a Comment