I don’t know how to achieve what you want but here is a sample on how to dynamically remove subpanels. I hope it gives you some light on what you want to accomplish:
Thank you for the reply. I’m trying to do something a bit different. I want to control what results are pulled from the db when we click “Select” inside the subpanel.
Then inside that custom class we would specify our custom filter by changing the value of $initial_filter
So we would replace $initial_filter = ”;
Here’s sample code if we want to display only records that have parent_project_id_c field value of “83b30b20-83a6-8099-b3b9-5d4a491888e6”. Note that you may have to add _advanced to the field name in order for it to work:
To find out the “field_name_in_vardef”, add your field to the detailview and then checkout the name of it in ‘name’ in the file: custom/Extension/modules/<modulename>/detailviewdefs.php
To find out the “field_name_in_popup”, first add this field to your Popup view, then show this popup view by clicking “Select” on the subpanel on which you want to enforce the filter, then use your browser’s Developer Tools “inspect” function to find out the “name” of the field for which you want to set your filter.
Afterwards, do a Admin → Repair → Quick Repair and Rebuild