Skip to Main Content
Feature Request FR-3042
Product Area APIs
Status OPEN

19 Voters

Add function to get Region ID by Static ID (in APEX_REGION package)

morten Public
· Mar 21 2023

Idea Summary
Many APEX API functions take a p_region_id parameter as an input. There is no built-in APEX method to get such a region ID, so each developer has to write his own query against the APEX dictionary views, either in a custom utility package, or by repeating the query again and again in code.

See also https://twitter.com/mortenbraten/status/1638075929887899648

Use Case
See above.

Preferred Solution (Optional)
Add APEX_REGION.GET_REGION_ID (p_app_id in number, p_page_id in number, p_region_static_id in varchar2) RETURN NUMBER. Additional parameters and/or overloads are possible.

The function could assume that Static IDs are unique (even though this is not enforced), and should return NULL both in case of no_data_found and too_many_rows.

This idea is open.

Comments

Comments

  • ino.laurensse OP5 months ago

    Very similar to rejected idea

    https://apex.oracle.com/ideas/FR-2785

  • jayson hanes Admin OP5 months ago

    @ino.laurensse it does.. I am planning to come up with a way to group similar ideas soon, so that any previous support isn't lost when reviewing anything like this that's not really entirely “new”

  • stew stryker OP5 months ago

    Building on what I read in https://apex.oracle.com/ideas/FR-2785…

    What if open_query_context and other routines that accept a region ID  parameter also offered an optional parameter of the region's Static ID. 

    One of those parameters would have to be non-null for it to work.

    Page IDs are pretty static, so I don't see a need to add a static Page ID parameter; it's the region ID that's tricky (for some of us) to get.

  • jeffrey kemp APEX Team OP4 months ago

    Agreed with this idea - and FR-2785 wasn't really rejected. If the developer puts the same static ID on multiple regions, it should raise TMR.

    Add an optional parameter that limits what types of regions it looks across (e.g. I'm looking for a particular IR region, so ignore regions of other types) which may reduce the likelihood of TMR in some cases.