Last active
May 21, 2019 13:25
-
-
Save Dani3lSun/f5e620e748fb09e1f352 to your computer and use it in GitHub Desktop.
PL/SQL function to check if an APEX item is rendered or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION is_pageitem_rendered(p_item_name IN VARCHAR2) RETURN BOOLEAN IS | |
-- | |
l_bool BOOLEAN; | |
-- | |
CURSOR l_cur_item IS | |
SELECT aapi.build_option_id, | |
aapi.condition_type_code, | |
aapi.condition_expression1, | |
aapi.condition_expression2, | |
aapi.authorization_scheme_id | |
FROM apex_application_page_items aapi | |
WHERE aapi.application_id = (SELECT nv('APP_ID') | |
FROM dual) | |
AND aapi.page_id = (SELECT nv('APP_PAGE_ID') | |
FROM dual) | |
AND aapi.item_name = upper(p_item_name); | |
l_rec_item l_cur_item%ROWTYPE; | |
-- | |
BEGIN | |
-- get needed item information | |
OPEN l_cur_item; | |
FETCH l_cur_item | |
INTO l_rec_item; | |
-- only check deeper, if item is found | |
IF l_cur_item%FOUND THEN | |
l_bool := apex_plugin_util.is_component_used(p_build_option_id => l_rec_item.build_option_id, | |
p_condition_type => l_rec_item.condition_type_code, | |
p_condition_expression1 => l_rec_item.condition_expression1, | |
p_condition_expression2 => l_rec_item.condition_expression2, | |
p_authorization_scheme_id => l_rec_item.authorization_scheme_id); | |
ELSE | |
l_bool := FALSE; | |
END IF; | |
-- | |
CLOSE l_cur_item; | |
-- | |
RETURN l_bool; | |
-- | |
END is_pageitem_rendered; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment