ecomsales Posted October 4, 2016 Report Share Posted October 4, 2016 I have a postings bulletin board website in which I have placed Caspio datapages. I received the following code, from a Caspio support specialist, placed in the Footer, which causes the posting contained in the database to expire, "deleted" after a given time, which works great: <script> function f_date(){ var v_currentDate=new Date(); v_currentDate.setDate(v_currentDate.getDate() +14); var v_assignDate = (v_currentDate.getMonth() + 1) + "/" + v_currentDate.getDate() + "/" + (v_currentDate.getFullYear()); document.getElementById('EditRecordExpiration_Date').value = v_assignDate; } f_date(); </script> I now need to create another postings bulletin board for a new website in which I can perform the following functions: 1) Cause the posting to auto-change from an Active status to an Inactive status at a specified date. The posting must able to be Deactivated manually, from the website front-end by the User or Admin, prior to the auto-deactivate. The Posting must also be able to be manually Reactivated by the User or Admin, from the front-end, after the auto-deactivate. I will need the auto-deactivate time period to reset each time the posting is Reactivated. 2) Then, if it is Reactivated, either after being Reactivated manually by the User or Admin, and then subsequently manually Deactivated or Auto-deactivated, I need to set an Auto-Delete date, after the posting has been Deactivated for a set period of time. Quote Link to comment Share on other sites More sharing options...
Kurumi Posted July 9, 2019 Report Share Posted July 9, 2019 Hi @ecomsales, You can use the new feature TASK on this certain scenario. This allows you to modify data based on a predefined time schedule which you can use to your postings. To know more about Tasks, check it here: https://howto.caspio.com/tasks/ Check this video for more information I hope it helps! Quote Link to comment Share on other sites More sharing options...
astroboy Posted November 29, 2020 Report Share Posted November 29, 2020 On 7/9/2019 at 2:50 PM, Meekeee said: Hi @ecomsales, You can use the new feature TASK on this certain scenario. This allows you to modify data based on a predefined time schedule which you can use to your postings. To know more about Tasks, check it here: https://howto.caspio.com/tasks/ Check this video for more information I hope it helps! To add on this, I think it would be a great addition to your application if you can add a feature that will send emails to your users as a reminder that their subscription is about to be expired and it needs renewal. I've found this video tutorial on how to implement this using application task, you may check it using this link: Quote Link to comment Share on other sites More sharing options...
astroboy Posted November 29, 2020 Report Share Posted November 29, 2020 On 10/4/2016 at 7:58 AM, ecomsales said: I have a postings bulletin board website in which I have placed Caspio datapages. I received the following code, from a Caspio support specialist, placed in the Footer, which causes the posting contained in the database to expire, "deleted" after a given time, which works great: <script> function f_date(){ var v_currentDate=new Date(); v_currentDate.setDate(v_currentDate.getDate() +14); var v_assignDate = (v_currentDate.getMonth() + 1) + "/" + v_currentDate.getDate() + "/" + (v_currentDate.getFullYear()); document.getElementById('EditRecordExpiration_Date').value = v_assignDate; } f_date(); </script> I now need to create another postings bulletin board for a new website in which I can perform the following functions: 1) Cause the posting to auto-change from an Active status to an Inactive status at a specified date. The posting must able to be Deactivated manually, from the website front-end by the User or Admin, prior to the auto-deactivate. The Posting must also be able to be manually Reactivated by the User or Admin, from the front-end, after the auto-deactivate. I will need the auto-deactivate time period to reset each time the posting is Reactivated. 2) Then, if it is Reactivated, either after being Reactivated manually by the User or Admin, and then subsequently manually Deactivated or Auto-deactivated, I need to set an Auto-Delete date, after the posting has been Deactivated for a set period of time. As for manually changing the status from the front end, what I suggest is to do this by creating a single update record form and receive the parameter from there to modify the specific record that you want to be updated. Here's a HowTo article that you may use as a reference: https://howto.caspio.com/datapages/forms/update-forms/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.