Page 1 of 1

Support master/detail joins using find_in_set

Posted: Thu Dec 16, 2021 5:23 am
by bkonia

Now that PHPMaker supports multiple parents in User ID security, it would also make sense to support creating master/detail joins in which a detail record can have multiple parents. The find_in_set operator could be used to create a join on a field containing comma-separated values.This feature could be implemented easily and seamlessly. If the user creates a join between an integer field and a varchar field, PHPMaker could assume the varchar is a comma-separated list. In this instance, instead of using the = operator, it would use the find_in_set operator, when creating the join.

I have a specific use case for a messaging system, where each message has a sender ID and a receipient ID. When viewing a user as an admin, I want to be able to view all messages sent by AND received by the user. Currently, I'm accomplishing this with a cumbersome workaround that generates a custom filter in the Recordset_Selecting event. It would be much cleaner if I could simply join the user ID field in the parent record to the user_ids field in the detail record. This user_ids field would be a comma-separated list, containing the sender and recipient IDs for the message.


Re: Support master/detail joins using find_in_set

Posted: Thu Dec 16, 2021 8:27 am
by mobhar

+1


Re: Support master/detail joins using find_in_set

Posted: Fri Jan 21, 2022 9:49 am
by ddiaz2380

+1


Re: Support master/detail joins using find_in_set

Posted: Fri Jan 21, 2022 7:05 pm
by buhuhu

+1


Re: Support master/detail joins using find_in_set

Posted: Wed Feb 09, 2022 6:25 am
by riverman

+1


Re: Support master/detail joins using find_in_set

Posted: Wed Feb 23, 2022 2:27 pm
by lamorte1977

+1


Re: Support master/detail joins using find_in_set

Posted: Thu Mar 24, 2022 4:38 am
by stefano

+1


Re: Support master/detail joins using find_in_set

Posted: Sun Sep 18, 2022 12:03 pm
by Webmaster

Try v2023.