Hey there friends,
Been bashing my head on this one all day and was hoping to get some further guidance. Here's what we have going on today:
- I have an XBasic function that is declared as such:
that runs a query, stores the results of the query in an array, and returns the array. Currently it returns [1]=13 [2]=5, which is expected.
- I have a session variable in onDialogInitialize as such:
as Alpha suggests for storing arrays in session variables.
- I have a numeric argument created called ARRAY_ALLOWEDUSERS that is pointing to session.ALLOWEDUSERS.
- I filter the list by
but my list is not being filtered.
Summed up, my goal is to filter a list control based on the results of a query I'm running, and the query returns me a list of numeric IDs. I've tried making the function return a string, building a comma-delimited string from the results of the query, and then filtering the list with that (to avoid arrays in session variables / arguments) but that causes me trouble too. Not sure if it's because it's comparing a number to a character, but for some reason some MySQL functions aren't available for filtering in list controls (such as CAST or CONVERT).
Oh, and I've also tried putting the query in the filter of the list (since Alpha lets you choose SQL Expression as a value in the filter) directly, but this causes an error as my query has a nested select inside of it.
Thanks in advance for your time!
Been bashing my head on this one all day and was hoping to get some further guidance. Here's what we have going on today:
- I have an XBasic function that is declared as such:
Code:
function GetUsers as n[] (e as p)
- I have a session variable in onDialogInitialize as such:
Code:
session.ALLOWEDUSERS = json_generate(GetUsers(e))
- I have a numeric argument created called ARRAY_ALLOWEDUSERS that is pointing to session.ALLOWEDUSERS.
- I filter the list by
Code:
employee_id IS NOT IN :ARRAY_ALLOWEDUSERS
Summed up, my goal is to filter a list control based on the results of a query I'm running, and the query returns me a list of numeric IDs. I've tried making the function return a string, building a comma-delimited string from the results of the query, and then filtering the list with that (to avoid arrays in session variables / arguments) but that causes me trouble too. Not sure if it's because it's comparing a number to a character, but for some reason some MySQL functions aren't available for filtering in list controls (such as CAST or CONVERT).
Oh, and I've also tried putting the query in the filter of the list (since Alpha lets you choose SQL Expression as a value in the filter) directly, but this causes an error as my query has a nested select inside of it.
Thanks in advance for your time!
Comment