5 Replies Latest reply on Mar 13, 2018 3:29 PM by fac586

    Dynamic Quick Picks Possible in Apex 5?

    rambo81

      Hi

      Is it possible to show quick picks next to a page item which are dynamic, based on the user who is logged in as this is checked against the application item related to the user logged in.

       

      For example if Joe who is a member of the groupA logs in he sees quick picks

       

      Joe1, Joe2, Joe3

       

      and if Steve who is a member of groupB logs in he sees quick picks

       

      Steve1, Steve2

       

      Hope someone can help?

        • 1. Re: Dynamic Quick Picks Possible in Apex 5?
          fac586

          rambo81 wrote:

           

          Is it possible to show quick picks next to a page item which are dynamic, based on the user who is logged in as this is checked against the application item related to the user logged in.

           

          For example if Joe who is a member of the groupA logs in he sees quick picks

           

          Joe1, Joe2, Joe3

           

          and if Steve who is a member of groupB logs in he sees quick picks

           

          Steve1, Steve2

           

          Hope someone can help?

          See Create dynamic Quick Pick with PL/SQL

          1 person found this helpful
          • 2. Re: Dynamic Quick Picks Possible in Apex 5?
            rambo81

            Hi

             

            Thanks for sharing the article.

             

            I am getting the following error when trying to create the PL/SQL shortcut

             

            • ORA-06550: line 4, column 13: PL/SQL: ORA-00904: "APEX_STRING"."FORMAT": invalid identifier ORA-06550: line 2, column 3: PL/SQL: SQL Statement ignored ORA-06550: line 11, column 10: PLS-00201: identifier 'APEX_STRING.FORMAT' must be declared ORA-06550: line 11, column 3: PL/SQL: Statement ignored

             

            This is my shortcut

             

            for picklist in ( 

              select 

                  listagg( 

                        apex_string.format(q'{<a href="javascript:$s('#P9_PLACE_OF_BIRTH#','%s','%s')">%s</a>}', e.pob, e.pob, e.pob) 

                      , ', ') 

                    within group ( 

                      order by e.pob) links 

              from 

                  (select distinct pob  FROM POBLOCATIONS WHERE COMPANY = '&REID.') e) 

            loop 

              return apex_string.format('<span class="apex-quick-picks">%s</span>', picklist.links); 

            end loop;

             

            Also when viewing the existing P9_PLACE_OF_BIRTH item details, I cannot see where I add 'POB_LOCATION' is it in the Post Element Text area of the item?

            • 3. Re: Dynamic Quick Picks Possible in Apex 5?
              fac586

              rambo81 wrote:

               

              Thanks for sharing the article.

               

              I am getting the following error when trying to create the PL/SQL shortcut

               

              • ORA-06550: line 4, column 13: PL/SQL: ORA-00904: "APEX_STRING"."FORMAT": invalid identifier ORA-06550: line 2, column 3: PL/SQL: SQL Statement ignored ORA-06550: line 11, column 10: PLS-00201: identifier 'APEX_STRING.FORMAT' must be declared ORA-06550: line 11, column 3: PL/SQL: Statement ignored

               

              This is my shortcut

               

              for picklist in (

              select

              listagg(

              apex_string.format(q'{<a href="javascript:$s('#P9_PLACE_OF_BIRTH#','%s','%s')">%s</a>}', e.pob, e.pob, e.pob)

              , ', ')

              within group (

              order by e.pob) links

              from

              (select distinct pob FROM POBLOCATIONS WHERE COMPANY = '&REID.') e)

              loop

              return apex_string.format('<span class="apex-quick-picks">%s</span>', picklist.links);

              end loop;

              apex_string.format was introduced in APEX 5.1. If using an earlier version the link HTML will have to be generated using string concatention.

              Also when viewing the existing P9_PLACE_OF_BIRTH item details, I cannot see where I add 'POB_LOCATION' is it in the Post Element Text area of the item?

              Yes. Also note that shortcut names are delimited by double quotes ("), not single quotes (').

              1 person found this helpful
              • 4. Re: Dynamic Quick Picks Possible in Apex 5?
                rambo81

                Hi

                 

                Thanks - how would I generate the link HTML using string concatenation?

                • 5. Re: Dynamic Quick Picks Possible in Apex 5?
                  fac586

                  rambo81 wrote:

                   

                  Thanks - how would I generate the link HTML using string concatenation?

                   

                  for picklist in (
                    select
                        listagg(
                              '<a href="javascript:$s(''#CURRENT_ITEM_NAME#'',''' || e.job || ''',''' || e.job || ''')">' || e.job || '</a>'
                            , ', ')
                          within group (
                            order by e.job) links
                    from
                        (select distinct job from emp) e)
                  loop
                    return '<span class="apex-quick-picks">' || picklist.links || '</span>';
                  end loop;
                  

                   

                  Makes things completely indecipherable...

                  1 person found this helpful