Calculated fields & Children tables
Posted: 2020-08-20 15:12
Hi All
I need some advice. I have in my app table "Employee" with some Children tables...
One of Children tables called "Trainings" where I can add any amount of trainings.
For field "Cert status" I used Calculated fields option with code below:
All works fine, just one problem, because Children table called "Trainings" not reloaded every visit to Employee Detailed view, Calculated fields not recalculated at field "Cert status" at Children tables.
Looks like I need add something for force to recalculated all fields at Children tables.
If I manually enter into each record, then all updated data will appear at field "Cert status".
Print Screen for better understanding.
I need some advice. I have in my app table "Employee" with some Children tables...
One of Children tables called "Trainings" where I can add any amount of trainings.
For field "Cert status" I used Calculated fields option with code below:
Code: Select all
SELECT
IF( DATEDIFF(`valid_until`, NOW()) >= 60,
'<span class="text-success">Valid</span>',
IF( DATEDIFF(`valid_until`, NOW()) >= 0,
'<span class="text-warning">Expiring</span>', '<span class="text-danger">Expired</span>'
)
)
FROM `trainings`
WHERE `id` = '%ID%'
Looks like I need add something for force to recalculated all fields at Children tables.
If I manually enter into each record, then all updated data will appear at field "Cert status".
Print Screen for better understanding.