I have a requirement to build a generic condition involving the region ID - in other words - I want to build a plsql function which is able to get the region ID from which it has been called
Perfect would be if I could do "V('REGION_ID')" – but it is not working.
Not working too is – “RETURN somefunction(‘#REGION_ID#’);” (PLSQL Function Body Returning a Boolean)
Is there maybe a package variable with this value ?
if anybody would have a hint for me - this would be great
Thanks a lot
Thanks for the reply, but unfortunately this is not what I was looking for.
But thanks to you, I found a similar question - same problem and no satisfactory reply too
You can set the Static ID of a region, and then refer to that via the APEX views.
This is a better approach, since Region IDs will change from instance to instance. Thus, if you refer to one of them in one environment, chances are that it won't exist in another environment.
- Scott -
this is what I currently have and its a good workaround.
But, it would be nicer if I would have no parameter or such - since the information is there ... somewhere.
In general, it would be nice to know from which "object" a condition was executed. I can imagine that my requirements will change sooner or later and I need such a logic for buttons and fields.
If you're using a condition, you can use the following to get a handle on the region ID in your PL/SQL code: wwv_flow.g_plug_id(wwv_flow.g_current_region_id)
This will unfortunately not work for PL/SQL executed as part of authorization schemes; only conditions.
Also, this will only work in APEX 4.0; it is not supported in APEX 3.2 & earlier. Thus, you'll have to wait until its released before you can use it.
Even with this approach, you'll have to keep in mind that Region ABC on Page 1 of App 123 will have a different ID once you export & import to another application; thus, you should try to store any rules that you will use in tables, so that things don't stop working when you promote your application from one instance to another.
Hope this helps!
- Scott -