How to put related list number of records into the field of database.

tanya2015

Member
Hello,
I need advice how to realize next issue. I have excursion group an tourist in it. Excursion has date and time. I have two table - groups and tourist. For every excursion I import list of tourist in the group join field is (date/ time) of excursion. Also I have in group table number of tourist in every group. When I import list of tourist I fill this field (count number of tourist in the imported list). But I need this value change depend on if I add new record or delete records from list of tourist for this group. I have this two list related and number of tourist in every group is in bracket (see .png). I need the same number in the column number. How can I manage this. This number must be updated in the group table if I delete persons in the list of tourist.
Calc element? Php event plugin? Default eval value? I can count number of tourist depend on excursion date. I can't use related data because I use group tables separately too and need nubmer of tourist in every group.
Thank you.
 

Attachments

  • 1234.png
    1234.png
    17 KB · Views: 73
Hi,

Your setup and explanation isn't 100% clear for me, but if you want to insert the count of related items to your list element, you can use PHP list plugin "onBeforeLoad", count the related records and update the fields. In that case every time the list is loaded, the count of related items will be updated.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top