Deleting an event should delete the activity automatically as long as it's done through the object and not just a database query. As for automating this it'd depend on when you want this to happen exactly. Do you want this to check for expired events on a schedule (e.g. every day check for expired and delete) or check if a user has expired events when they login for example?
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Ok, the below auto action will delete all expired events. This should also delete their activity since it's doing so from their objects. It takes the end date of the event, or the start date if it doesn't have one, and adds 24 hours to it then checks if the current date is greater than that. If it is then it's considered expired.
Now comes the part of how you want to run this. You can use a Joomla scheduled task to run it on regular intervals as CB Auto Actions includes a scheduled task for running auto actions or you can setup CRON to access the auto action directly. If you plan to use a Joomla scheduled task then please be sure to set "Allow Direct Access" to "No" under the Global tab otherwise leave it as "Yes" and schedule a wget CRON against the "Internal Action URL".
Also since this is a mass delete operation please be sure you make a backup and test carefully.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.