0 Replies Latest reply on Aug 10, 2018 1:34 PM by Inboka

    Interactive Grid: Refresh column definition




      I'm searching for a solution to refresh the apex column definition of an interactive grid from pl/sql (so you don't have to go to the page editor and modify the source of your IG and push Save anymore)


      Let me quickly explain our case and why we want to do it this way. In our system we define our basic_table with our predefined columns. Our customers sometimes want to define custom fields which are handled by a custom package/screen where they can define the name/type/... of that field/column. The package will than do an alter table in the flex_table and add the defined field/column. It will also refresh the JOIN_VIEW. In the join_view we join the 2 tables on the PK in BASIC_TABLE so we can get all the field on an interactive grid.



      As you can see everything is made in a dynamic way for the flex_table. In the back all the changes are handled. Now we also want to show all the columns in an interactive grid to our customer by also calling a pl/sql procedure. I already found a solution to do this for an interactive report Synchronize IR columns via plsql API , but this solution doesn't work for an interactive grid. I've tried to run the procedure  wwv_flow_worksheet_standard.synch_report_columns for an interactive grid region but it throws an error. 

      I get an error: ORA-01400: cannot insert NULL into ("APEX_180100"."WWV_FLOW_WORKSHEET_COLUMNS"."WORKSHEET_ID")


      In order to find a solution I've also looked at the concept of flexfields in packaged apps, but here we already have to define a fix amount of columns in the flex_table an place conditions on the report to check if you need to show the column or not. We really want to create the columns as the customer needs them and we want to offer the Interactive grid to the customer as this has the best functionalities.


      Does anyone have a suggestion to get the new columns in the interactive grid dynamically? We are using APEX 18.1.