Just curious if there is a best practice when wanting to use global variables across an APEX application. Do people use APEX’s APPLICATION_ITEMS or just add PAGE_ITEMS to the Global Page (Page 0)? My initial thought is to use APPLICATION_ITEMS since that is their intended purpose, but using Page 0 gets around the small extra step when of having to reference an APPLICATION_ITEM from JavaScript.
Any performance issues or potential caveats I may hit either way that I may not be aware of?
>Solution :
The way I see it, Page 0 items are useful if you want to display the same contents on different pages so that you wouldn’t have to maintain many items everywhere, but only on Page 0. If you want to use them as "invisible" global variables, you’d then have to hide them using a server-side condition or dynamic action. But, why would you then use Page 0 items? Use application items instead!
Application items are true global variables; they aren’t displayed anywhere in the application, but contain values you use wherever you need them. Not that you can’t display their values – you can, but that’s not the issue we’re discussing here.
I haven’t noticed any performance issues while using any of these.