Auto delete records based on amount of records and age

Auto delete records based on amount of records and age

Hi there,

in our Creator dashboard we have hundreds of apps, each app has a form and a report. Most reports now have several hundred records each - managing and clearing these out when we start to run out of space is becoming a monstrous job therefore I'm looking to create a couple of clever little delete functions to help me out.


For a bit of background, we use creator in order to take and send messages to clients, the form uses a sendmail function to email the client, the report is used as a history view. The form below is a generic example of how we do things via sendmail. At the top is a signature which is being used like a global function
 by calling the "callsignature" string from the "dynamic_signature" app.

  1. signature=dynamic_signature.callsignature();
  2. sendmail
  3. [
  4.     from:zoho.adminuserid
  5.     to:"###@####.co.uk"
  6.     subject:"MESSAGE"
  7.     message:"<br>You have a new message for ####: " + formdata + "<br><div></div><div><br></div><div><br></div><br>" + signature + "<br><br><br>_<br>"
  8.     content type:HTML
  9. ]

I want to create the delete scripts in a similar  way that the signature has been done. The signature is declared as a global variable from a "Dynamic Siganture" application where there is various different signatures listed - the one in use being callsignature

So I want to create 2 delete scripts in this same fashion so that I can place and use them per application as required.

Script 1: would be to keep only the last 100 records entered

Script 2: would delete records over  6 months old.


The reason being is that those with a "call" signature only require around 100 records to be kept, everything else we need a 6 month record history.




I have been trying to research this but there is nothing within the last few years that is of any help I would appreciate if someone could tell me or show me how to create these two scripts

    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner









                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources

                                                                                              Zoho Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方