I am trying to do the following query within a select dynamic field:
SELECT refresher_period as value, refresher_period as text FROM #__cck_store_join_seb_site_training WHERE site_id=$site->id AND course_id=$config['pk'] ORDER BY text
But I don't seem to be able to access the $config variable? I can access the $uri variable it seems, but this only works to retrieve the value when displaying/editing the form, and not when trying to use the field in a list and search, but I need to access it in both circumstances.
This was due to the field I was using not having a storage location in the database. I managed to work around this by using a join and query in the search and a free text field to retrieve the variable from the search in the search form. Thanks to Olivier Nolbert for the direction on this.