{"id":1739,"date":"2024-04-01T12:15:09","date_gmt":"2024-04-01T10:15:09","guid":{"rendered":"https:\/\/chaoyu.nl\/?p=1739"},"modified":"2024-10-24T19:03:28","modified_gmt":"2024-10-24T17:03:28","slug":"oracle-apex-cheat-sheets-on-going","status":"publish","type":"post","link":"https:\/\/chaoyu.nl\/?p=1739","title":{"rendered":"Oracle APEX cheat sheets (on going)"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><i class=\"fas fa-list\"><\/i> Content<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#id_page_items\" data-type=\"internal\" data-id=\"#id_page_items\">Page items<\/a><\/li>\n\n\n\n<li><a href=\"#id_session_override\" data-type=\"internal\" data-id=\"#id_session_override\">Session override<\/a><\/li>\n\n\n\n<li><a href=\"#id_auth\" data-type=\"internal\" data-id=\"#id_auth\">Authentication ( customs, mix of social sign ins)<\/a><\/li>\n\n\n\n<li><a href=\"#ajax\" data-type=\"internal\" data-id=\"#ajax\">Ajax<\/a><\/li>\n\n\n\n<li><a href=\"#ACTIVE_TAB\" data-type=\"internal\" data-id=\"#ACTIVE_TAB\">APEX Tab Container Dynamic Set Active<\/a>\n<ul class=\"wp-block-list\">\n<li>on Page Load<\/li>\n\n\n\n<li>with Javascript when page is loaded<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#PLSQLCOLLCTION\" data-type=\"internal\" data-id=\"#PLSQLCOLLCTION\">plsql table collection (array)<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"id_page_items\"><i class=\"fas fa-sitemap\"><\/i> <strong>Page items<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>:P1_ITEM<\/td><td>reference in sql \/plsql on page designer(only)<\/td><\/tr><tr><td>&amp;P1_ITEM.<\/td><td>Static Text (exact)<br><strong>Note<\/strong>: Exact substitution syntax should be avoided in SQL or PL\/SQL code because it can result in SQL Injection vulnerabilities<\/td><\/tr><tr><td>#P1_ITEM#<\/td><td>template <\/td><\/tr><tr><td>v(&#8216;P1_ITEM&#8217;), nv(&#8216;P1_ITEM&#8217;) &#8211; ! it is not deterministic function , can lead to performance issue on heavy queries <\/td><td>on page designer and database ( use apex_session.attach in database)<br>if ever facing performance issue on v and nv , create pipelined function with in parameters , or try apex session collection to store page items and use saclar sub query to cross join it<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"id_session_override\"> Session Override <i class=\"fas fa-arrow-right-arrow-left\"><\/i> for better CSS and JS development<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">use VS code &#8220;Go Live&#8221; option to host local css or js files<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"281\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.12.22-1024x281.png\" alt=\"\" class=\"wp-image-1742\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.12.22-1024x281.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.12.22-300x82.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.12.22-768x210.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.12.22-1536x421.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.12.22-2048x561.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.12.22-850x233.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">and use apex session override to load it and  develop it<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"764\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.11.20-1024x764.png\" alt=\"\" class=\"wp-image-1743\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.11.20-1024x764.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.11.20-300x224.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.11.20-768x573.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.11.20-1536x1147.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.11.20-2048x1529.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.11.20-850x634.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"id_auth\"><i class=\"fas fa-id-card-clip\"><\/i> Authentications<\/h3>\n\n\n\n<h4 class=\"wp-block-heading has-cyan-bluish-gray-background-color has-background\"><i class=\"fas fa-user-lock\"><\/i><strong> Custom Authentication<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">the use case is that you have a user table defined that you like to use for fine-grained access control.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">it is relatively simple, create an custom type of authentication and provide a function which returns boolean. ( if user pass username + pwd return true else false ) and reference it in settings &gt; authentication function name. it takes in on default 2 parameters <code>p_username, p_password<\/code><\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be6118226&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be6118226\" class=\"wp-block-image size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"554\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.49.49-1024x554.png\" alt=\"\" class=\"wp-image-1746\" style=\"width:366px;height:auto\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.49.49-1024x554.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.49.49-300x162.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.49.49-768x415.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.49.49-1536x831.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.49.49-2048x1108.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-12.49.49-850x460.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h4 class=\"wp-block-heading has-pale-cyan-blue-background-color has-background\"> <i class=\"fab fa-google\"><\/i> Google Authentication<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>create web credentials \n<ol class=\"wp-block-list\">\n<li>create api credentials on google cloud console , <a href=\"https:\/\/chaoyu.nl\/?p=1515\" data-type=\"link\" data-id=\"https:\/\/chaoyu.nl\/?p=1515\">read here<\/a><\/li>\n\n\n\n<li>create idp in apex builder( read image carefully )\n<ul class=\"wp-block-list\">\n<li>two settings in <strong><mark style=\"background-color:#abb8c3\" class=\"has-inline-color has-black-color\">Login Processing<\/mark><\/strong>  \n<ol class=\"wp-block-list\">\n<li>switching session = Y if mix authentication types<\/li>\n\n\n\n<li>post authentication procedure, this is the actual handler of matching emails from your custom user table ( see code snippet)<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\">procedure my_post_auth\nis\nl_count number;\nbegin\nselect count(1) into l_count from readcast_user t where upper(t.email) = upper(v('APP_USER'));\n    if l_count = 1 then \nnull;\nelse \n htp.init;\n apex_util.redirect_url (p_url =&gt; 'https:\/\/oci.chaoyu.nl\/ords\/r\/api\/readcast\/error-page'); \n apex_application.stop_apex_engine;\nend if;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>create authentications<\/li>\n<\/ul>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be61188c1&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be61188c1\" class=\"wp-block-image size-large is-resized is-style-default wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"497\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.20.28-1-1024x497.png\" alt=\"\" class=\"wp-image-1754\" style=\"width:837px;height:auto\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.20.28-1-1024x497.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.20.28-1-300x146.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.20.28-1-768x373.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.20.28-1-1536x745.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.20.28-1-2048x994.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.20.28-1-850x412.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be6118d95&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be6118d95\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"558\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.24.45-1024x558.png\" alt=\"\" class=\"wp-image-1758\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.24.45-1024x558.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.24.45-300x164.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.24.45-768x419.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.24.45-1536x837.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.24.45-2048x1116.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.24.45-850x463.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be6119263&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be6119263\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"209\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.25.09-1-1024x209.png\" alt=\"\" class=\"wp-image-1759\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.25.09-1-1024x209.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.25.09-1-300x61.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.25.09-1-768x157.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.25.09-1-1536x313.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.25.09-1-2048x417.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.25.09-1-850x173.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h4 class=\"wp-block-heading has-pale-pink-background-color has-background\"><i class=\"fab fa-microsoft\"><\/i> MS authentications<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>create web credentials\n<ul class=\"wp-block-list\">\n<li>create api credentials on azure cloud console , <a href=\"https:\/\/chaoyu.nl\/?p=1515\" data-type=\"link\" data-id=\"https:\/\/chaoyu.nl\/?p=1515\">read here<\/a><\/li>\n\n\n\n<li>create APEX web credentials\n<ul class=\"wp-block-list\">\n<li>discovery link is from azure <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be611981b&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be611981b\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.52.20-1024x300.png\" alt=\"\" class=\"wp-image-1766\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.52.20-1024x300.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.52.20-300x88.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.52.20-768x225.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.52.20-1536x450.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.52.20-2048x600.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.52.20-850x249.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be6119cee&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be6119cee\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"697\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.48.39-1024x697.png\" alt=\"\" class=\"wp-image-1763\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.48.39-1024x697.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.48.39-300x204.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.48.39-768x523.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.48.39-1536x1045.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.48.39-850x578.png 850w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.48.39.png 1802w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>create authentications<\/li>\n<\/ul>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be611a363&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be611a363\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"847\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.50.19-1024x847.png\" alt=\"\" class=\"wp-image-1765\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.50.19-1024x847.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.50.19-300x248.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.50.19-768x635.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.50.19-1536x1271.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.50.19-850x703.png 850w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.50.19.png 1924w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be611ae83&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be611ae83\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"257\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.53.59-1-1024x257.png\" alt=\"\" class=\"wp-image-1769\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.53.59-1-1024x257.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.53.59-1-300x75.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.53.59-1-768x193.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.53.59-1-1536x385.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.53.59-1-2048x514.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.53.59-1-850x213.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use Mixed Authentication Schemas<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">I have defined 3 types of Authentications types, I am having custom ( username + pwd ) as defaut. And I would like to use all 3 of them at the same time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"113\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.00.44-1024x113.png\" alt=\"\" class=\"wp-image-1773\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.00.44-1024x113.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.00.44-300x33.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.00.44-768x85.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.00.44-1536x169.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.00.44-2048x226.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.00.44-850x94.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">here are the steps: <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>create buttons on page, change action to redirect to a <strong>none<\/strong> public page \n<ul class=\"wp-block-list\">\n<li>e.g on #3 request is <code>APEX_AUTHENTICATION=GOOGLE <\/code>or MS change it to <code>APEX_AUTHENTICATION=MS<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be611b99b&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be611b99b\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"432\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.03.47-1024x432.png\" alt=\"\" class=\"wp-image-1774\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.03.47-1024x432.png 1024w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.03.47-300x126.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.03.47-768x324.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.03.47-1536x647.png 1536w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.03.47-2048x863.png 2048w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-14.03.47-850x358.png 850w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6ac0be611c12e&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6ac0be611c12e\" class=\"wp-block-image size-large is-resized wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"907\" height=\"1024\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.38.59-907x1024.png\" alt=\"\" class=\"wp-image-1777\" style=\"width:184px;height:auto\" srcset=\"https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.38.59-907x1024.png 907w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.38.59-266x300.png 266w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.38.59-768x867.png 768w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.38.59-300x339.png 300w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.38.59-850x960.png 850w, https:\/\/chaoyu.nl\/wp-content\/uploads\/2024\/04\/Screenshot-2024-04-01-at-13.38.59.png 1102w\" sizes=\"auto, (max-width: 907px) 100vw, 907px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/blog.cloudnueva.com\/setting-an-apex-authentication-scheme-at-run-time\" data-type=\"link\" data-id=\"https:\/\/blog.cloudnueva.com\/setting-an-apex-authentication-scheme-at-run-time\">Here to read on even more advanced use case.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"ajax\"><strong>AJAX<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">make apex.server.process into<strong> async and await<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">function myAsyncFunction() {\n    return apex.server.process(\"SYNC_PODCAST\",\n        {\n            pageItems: [\"P9005_ID\"] -- this is important, else server side code cannot read P9005_ID\n        }\n    )\n};\nasync function myAsyncTask() {\n    try {\n        let result = await myAsyncFunction();\n        console.log(\"Async operation successful:\", result);\n        --json_result = JSON.stringify(result);\n        --console.log(json_result);\n        if (result.status == 'error') {\n            apex.message.showErrors([\n                {\n                    type: \"error\",\n                    location: \"page\",\n                    message: result.message,\n                    unsafe: false\n                }\n            ]);\n        } else {\n            apex.message.showPageSuccess(\"Podcast synced!\");\n        }\n        \/\/ Further processing after async operation completes\n    } catch (error) {\n        console.error(\"Async operation failed:\" + error);\n        \/\/ Handle error\n        apex.message.showErrors([\n            {\n                type: \"error\",\n                location: \"page\",\n                message: \"Ajax error has occurred! \" +error,\n                unsafe: false\n            }\n        ]);\n    }\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">-- to call the function\nmyAsyncTask(); <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Server side code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\">begin \n    readcast_main.pr_merge_podcast_from_rss_xml(i_podcast_id =&gt; :P9005_ID);\n    -- Open a new JSON object\n    apex_json.open_object;\n    -- Write a key-value pair to the JSON object\n    apex_json.write('status', 'successful');\n    apex_json.write('id', :P9005_ID);\n    -- Write another key-value pair to the JSON object\n    -- Close the JSON object\n    apex_json.close_object;\nEXCEPTION\n    WHEN OTHERS THEN\n    -- sqlerrm is a PL\/SQL built-in function that retrieves the textual \n    -- description of the error associated with the most recent exception.\n    --  It is commonly used for debugging and error handling.\n    -- Open a new JSON object\n    apex_json.open_object;\n    -- Write a key-value pair to the JSON object\n    apex_json.write('status', 'error');\n    apex_json.write('message', sqlerrm);\n    -- Write another key-value pair to the JSON object\n    -- Close the JSON object\n    apex_json.close_object;\nend;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"PLSQLCOLLCTION\"><strong>PLSQL COLLECTION<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">declare a type <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\">  type ty_my_record_type is record(\n     item_1 varchar2(100 char)\n    ,item_2 varchar2(100 char));<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">declare a table type <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\"> type ty_my_table is table of ty_my_record_type;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Init a table with table type <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql line-numbers\">l_my_table ty_my_table;\n --- fill collection --- \nselect *\nfrom   (select '1'\n              ,'2'\n        from   dual\n        union all\n        select '1'\n              ,'2'\n        from   dual\n        union all\n        select '1'\n              ,'2'\n        from   dual\n        union all\n        select '1'\n              ,'2'\n        from   dual)\nbulk   collect\ninto   l_my_table;\n\n--- using dynamic sql --- \ndeclare \n  l_sql varchar2(3000 char) := 'select :1, :2 from dual';\nbegin\n  execute immediate l_sql bulk collect\n    into l_my_table\n    using 'text1', 'text2';\nend;\n\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ACTIVE_TAB\">APEX Tab Container Dynamic Set Active<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Both methods require you to set static id for <strong>tab container<\/strong> and <strong>each seperated tabs.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">On Page Load (require Remeber Active tab enabled)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Say, you have 3 pages. <\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<ul class=\"wp-block-list\">\n<li>Page A <\/li>\n\n\n\n<li>Page B <\/li>\n\n\n\n<li>Page C ( with a tab container and within 2 tabs)\n<ul class=\"wp-block-list\">\n<li>tab-0001<\/li>\n\n\n\n<li>tab-0002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">From page A , B you would like to redirect to Page C.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When C is opened from A, you would like to make tab-0001 active.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When C is opened from B, you would like to make tab-0002 ative.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The trick is use session storage, what we need to do is to set the session storage item <strong>ORA_WWV_apex.apexTabs.111.1907.Demo1.activeTab<\/strong> to the static id of the tab you would like to have active<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var sesStorage = apex.storage.getScopedSessionStorage({\n    prefix: \"ORA_WWV_apex\",\n    useAppId: false\n});\nsesStorage.setItem(\"<strong>apexTabs.\"+\"&amp;APP_ID.\"+\".3.Demo1.activeTab<\/strong>\", \"#SR_baseball_tb_reg\")\n\n#3 is the page number for page C\n# #SR_baseball_tb_reg is the tab static id\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">this function should be attached on page A and B on the action before redirect.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">After Page is Loaded<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">say you would like to create a button to set tab active and unactive, here is how.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">apex.region(\"{tab_container_id}\").widget().aTabs(\"getTabs\")[\"#{tab_id}\"].makeActive();<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Content Page items :P1_ITEM reference in sql \/plsql on page designer(only) &amp;P1_ITEM. Static Text (exact)Note: Exact substitution syntax should be avoided in SQL or PL\/SQL code because it can result in SQL Injection vulnerabilities #P1_ITEM# template v(&#8216;P1_ITEM&#8217;), nv(&#8216;P1_ITEM&#8217;) &#8211; ! it is not deterministic function , can lead to performance issue on heavy queries on&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,57],"tags":[],"class_list":["post-1739","post","type-post","status-publish","format-standard","hentry","category-apex","category-oracle-apex"],"_links":{"self":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1739"}],"version-history":[{"count":54,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1739\/revisions"}],"predecessor-version":[{"id":1823,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=\/wp\/v2\/posts\/1739\/revisions\/1823"}],"wp:attachment":[{"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chaoyu.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}