Egocentralis
Member
Hi,
We create company;s with employees and customers on our website. We connect the data via a bedrijf_id (company_id)
The data is stored in different tables.
Now, when we want to delete a company from the website (if they cancel subscription) we want also the connected data dissapear from the other tables.
I tried to achieve this with a php plugin (in the form).
In the plugin we set: On record deletion (onDeleteRowsForm)
Then as code we set:
But when clicking delete, and confirm the deletion we get a spinning wheel and nothing happens.
We tried to adjust the query a bit but that did not help.
How can we get it like when pressing delete, all data from the other tables will be deleted also??
We create company;s with employees and customers on our website. We connect the data via a bedrijf_id (company_id)
The data is stored in different tables.
Now, when we want to delete a company from the website (if they cancel subscription) we want also the connected data dissapear from the other tables.
I tried to achieve this with a php plugin (in the form).
In the plugin we set: On record deletion (onDeleteRowsForm)
Then as code we set:
Code:
$bedrijfid = '{egocentralis_bedrijven___bedrijf_id}';
$db_deletef = FabrikWorker::getDbo();
$query_deletef = $db_deletef->getQuery(true);
$query_deletef
->delete('g4e_orakel_functies')
->where('bedrijf_id = ' $mydb->quote($bedrijfid));
$db_deletef->setQuery($query_deletef);
$query_deleteu = $db_deletef->getQuery(true);
$query_deleteu
->delete('g4e_orakel_urencode')
->where('bedrijf_id = ' $mydb->quote($bedrijfid));
$db_deletef->setQuery($query_deleteu);
$db_deletef->execute();
But when clicking delete, and confirm the deletion we get a spinning wheel and nothing happens.
We tried to adjust the query a bit but that did not help.
How can we get it like when pressing delete, all data from the other tables will be deleted also??