Dear Eugenio, hi!
I am looking for your advise because apparently when the application run the custom functions the global variables related to logged in users and connection are not yet declared or determined.
I'm building an application where I want that a group of users can select_single from a list which filtered based on their country.
Description:
1 - I added one column "country" to the dadabik_users table.
2 - there is one table, called "beneficiaries", containing a column named "country".
3 - there is another table, called "field_visits", containing a column named "beneficiary_id".
What is currently happening, is that a logged in user (which belongs to a specific group) can create a new record to the "field_visits" table; In the "field_visits" form configurator I set that the beneficiary_id can be chosen based on the beneficiary "full_name" which is driven from the "beneficiaries table".
So far so good!
Now, I want that only beneficiaries of the same country of the logged in user will be showed in the list.
Question #1: since I added one column to the dadabik_user table is by chance any easy way I can get also the "country" of the user as a global variable (so I can directly indicate it in the where clause of the form configurator)?
Alternatively, I am trying solve using a custom function but whatever I think is based on the fact I should know already what is the logged in user ID to retrieve its country and then return this information include it in the where clause of the configurator.
I hope I managed to express my problem and my question properly.
Thank you anyway for all your great work.
Leone
You are running the latest release of DaDaBIK
In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enterprise to Platinum) please contact us.
mysql version: 5.5.5-10.3.24-MariaDB
Web server: Apache
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15
I am looking for your advise because apparently when the application run the custom functions the global variables related to logged in users and connection are not yet declared or determined.
I'm building an application where I want that a group of users can select_single from a list which filtered based on their country.
Description:
1 - I added one column "country" to the dadabik_users table.
2 - there is one table, called "beneficiaries", containing a column named "country".
3 - there is another table, called "field_visits", containing a column named "beneficiary_id".
What is currently happening, is that a logged in user (which belongs to a specific group) can create a new record to the "field_visits" table; In the "field_visits" form configurator I set that the beneficiary_id can be chosen based on the beneficiary "full_name" which is driven from the "beneficiaries table".
So far so good!
Now, I want that only beneficiaries of the same country of the logged in user will be showed in the list.
Question #1: since I added one column to the dadabik_user table is by chance any easy way I can get also the "country" of the user as a global variable (so I can directly indicate it in the where clause of the form configurator)?
Alternatively, I am trying solve using a custom function but whatever I think is based on the fact I should know already what is the logged in user ID to retrieve its country and then return this information include it in the where clause of the configurator.
I hope I managed to express my problem and my question properly.
Thank you anyway for all your great work.
Leone
Your current DaDaBIK version
You are using DaDaBIK version 11.7-Elba enterprise, installed on 23-09-2022 (installation code: 18232632dba4dd7cdc), the latest version of DaDaBIK is 11.7-Elba released on 18-08-2022You are running the latest release of DaDaBIK
In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enterprise to Platinum) please contact us.
System info
PHP Version: 7.3.29mysql version: 5.5.5-10.3.24-MariaDB
Web server: Apache
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15