Hi,
I have the following setup in my SQL DB:
- 1 table (buildings)
- 1 table (meters)
with an 1:n association between them (1 building can have multiple meters).
On CF side, I have one form detailed all the fields from "buildings" table + 1 multiplier for "meters" tables.
I also display a summary page listing all the buildings in a table; for this purpose I use CC. CC list all the buildings (1 building per line), and 2 buttons per line: edit (opens CC form) and delete. CC form has one model: "buildings".
With this setup, I have 4 questions/issues:
1) I would like to display, in the CC buildings summary page, the number of meters per building (ie in each line, next to building information retrieved from buildings table, a cell displaying the number of meters for this building). I have no clue how to proceed. I tried to add a second model in CC for "meters", but after that I don't know how to proceed.
2) In CC page, when I click the delete button, the building entry is deleted but the associated meters are not. Again, no idea how to proceed here.
3) Noticed something strange in the multiplier: if I create a new building and add meters, these meters will receive a uniq_id in their SQL table. However, if I edit an existing building and add some meters, these new meters will have an empty uniq_id field.
Thanks for any help🙂
I have the following setup in my SQL DB:
- 1 table (buildings)
- 1 table (meters)
with an 1:n association between them (1 building can have multiple meters).
On CF side, I have one form detailed all the fields from "buildings" table + 1 multiplier for "meters" tables.
I also display a summary page listing all the buildings in a table; for this purpose I use CC. CC list all the buildings (1 building per line), and 2 buttons per line: edit (opens CC form) and delete. CC form has one model: "buildings".
With this setup, I have 4 questions/issues:
1) I would like to display, in the CC buildings summary page, the number of meters per building (ie in each line, next to building information retrieved from buildings table, a cell displaying the number of meters for this building). I have no clue how to proceed. I tried to add a second model in CC for "meters", but after that I don't know how to proceed.
2) In CC page, when I click the delete button, the building entry is deleted but the associated meters are not. Again, no idea how to proceed here.
3) Noticed something strange in the multiplier: if I create a new building and add meters, these meters will receive a uniq_id in their SQL table. However, if I edit an existing building and add some meters, these new meters will have an empty uniq_id field.
Thanks for any help🙂