Store records for 30 days after deletion

Store records for 30 days after deletion

Requirement

Deleted records must be stored for 30 days after deletion, after which they should be permanently removed from the database.

Use Case

A library management app is used to manage books, memberships, and other resources. When a membership is cancelled, it can be reclaimed within the next 30 days. After 30 days, customers need to purchase a new membership, if required. So, cancelled membership records are stored for 30 days before before being permanently removed from the database.
 

Steps to follow

1. Create two forms with the following details:
Form
Form Link Name
Field Type
Field Name
Field Link Name
Add Member
Add_Member
Single Line
Name
Name
Phone
Phone Number
Phone_Number
Email
Email
Email
Image
Photo
Photo
Auto Number
Member ID
Member_ID
Cancelled Membership
Cancelled_Membership
 
Name
Name
Name
Single Line
Member ID
Member_ID
 
Let's create a workflow to move deleted records from Add Member form to Cancelled Membership form
 
2. Create workflow with the following details.
The workflow is to be triggered when a record is being deleted , so we are selecting the Form Event as "Validations on record deletion".
 
3. Click Add New Action > Deluge Script, and save the following D eluge snippet in the Deluge editor:
  1. var = insert into Cancelled_Membership
  2. [
  3.   Added_User=zoho.loginuser
  4.   Name=input.Name
  5.   Member_ID=input.Member_ID
  6. ];
The snippet uses the add records Deluge task to add the member's details in Cancelled Membership form when a member's record is deleted from the Add Member form.
 
4. Next, let's create a workflow in Schedules to delete the records in the Cancelled Membership form after 30 days.
We have selected Added Time as the Start date field, so that records are deleted 30 days after they have been added.
 
5. Click Add New Action > Deluge Script and save the following script in the editor
  1. delete from Cancelled_Membership [ ID == input.ID ];

See how it works  

Points to note  

  • Form Event can also be set as "Successful record deletion" instead of "Validations on record deletion". However, it is safer to use the current method, since records are added to the other form before the records are deleted from the current form.
  • We can add a custom button to the Cancelled Membership form to add the member's record back to the Add Member form if a member decides to retain the membership .
  • A daily schedule can also be configured to delete records that have completed 30 days.

      Create. Review. Publish.

      Write, edit, collaborate on, and publish documents to different content management platforms.

      Get Started Now


        Access your files securely from anywhere

          Zoho CRM Training Programs

          Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

          Zoho CRM Training
            Redefine the way you work
            with Zoho Workplace

              Zoho DataPrep Personalized Demo

              If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

              Zoho CRM Training

                Create, share, and deliver

                beautiful slides from anywhere.

                Get Started Now


                  Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                  BOOK A SESSION







                              Quick LinksWorkflow AutomationData Collection
                              Web FormsEnterpriseOnline Data Collection Tool
                              Embeddable FormsBankingBegin Data Collection
                              Interactive FormsWorkplaceData Collection App
                              CRM FormsCustomer ServiceAccessible Forms
                              Digital FormsMarketingForms for Small Business
                              HTML FormsEducationForms for Enterprise
                              Contact FormsE-commerceForms for any business
                              Lead Generation FormsHealthcareForms for Startups
                              Wordpress FormsCustomer onboardingForms for Small Business
                              No Code FormsConstructionRSVP tool for holidays
                              Free FormsTravelFeatures for Order Forms
                              Prefill FormsNon-Profit

                              Intake FormsLegal
                              Mobile App
                              Form DesignerHR
                              Mobile Forms
                              Card FormsFoodOffline Forms
                              Assign FormsPhotographyMobile Forms Features
                              Translate FormsReal EstateKiosk in Mobile Forms
                              Electronic Forms
                              Drag & drop form builder

                              Notification Emails for FormsAlternativesSecurity & Compliance
                              Holiday FormsGoogle Forms alternative GDPR
                              Form to PDFJotform alternativeHIPAA Forms
                              Email FormsFormstack alternativeEncrypted Forms

                              Wufoo alternativeSecure Forms

                              WCAG

                                      Create. Review. Publish.

                                      Write, edit, collaborate on, and publish documents to different content management platforms.

                                      Get Started Now







                                                        You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                            Manage your brands on social media


                                                              • Desk Community Learning Series


                                                              • Digest


                                                              • Functions


                                                              • Meetups


                                                              • Kbase


                                                              • Resources


                                                              • Glossary


                                                              • Desk Marketplace


                                                              • MVP Corner


                                                              • Word of the Day


                                                              • Ask the Experts


                                                                Zoho Sheet Resources

                                                                 

                                                                    Zoho Forms Resources


                                                                      Secure your business
                                                                      communication with Zoho Mail


                                                                      Mail on the move with
                                                                      Zoho Mail mobile application

                                                                        Stay on top of your schedule
                                                                        at all times


                                                                        Carry your calendar with you
                                                                        Anytime, anywhere




                                                                              Zoho Sign Resources

                                                                                Sign, Paperless!

                                                                                Sign and send business documents on the go!

                                                                                Get Started Now




                                                                                        Zoho TeamInbox Resources





                                                                                                  Zoho DataPrep Demo

                                                                                                  Get a personalized demo or POC

                                                                                                  REGISTER NOW


                                                                                                    Design. Discuss. Deliver.

                                                                                                    Create visually engaging stories with Zoho Show.

                                                                                                    Get Started Now








                                                                                                                        • Related Articles

                                                                                                                        • Understanding delete record action

                                                                                                                          The Delete Record action in data access of workflows is a variant of the same action in deluge script. In the latter, you need to create the code for deleting a record in the script builder. Instead, you can use the predefined action available. When ...
                                                                                                                        • Adding records

                                                                                                                          Overview A record in Zoho Creator is a row of data submitted through a form. The data submitted through a form is stored in the application itself and reports help present it in a meaningful way. Who can add records? The application owner Shared ...
                                                                                                                        • If I delete a record in a form (table) that has "child" records in another form, the child records are not deleted. How can I delete the child records?

                                                                                                                          bout the application The application Deleting child nodes illustrates how to delete child records when a record is deleted from the parent form.The applicationcomprises of two forms: Client form to enter the client name (master form). Client ...
                                                                                                                        • Delete choice

                                                                                                                          Delete a choice from a choice field Applicable to the following choice fields: Drop down , radio , multi select , and checkbox . Open the form builder. Select the required field. Navigate to the Field Properties > Choices section on the right. Click ...
                                                                                                                        • Delete and duplicate records

                                                                                                                          This API service lets you manage the different functionalities in a report. Delete and duplicate records Methods deleteRecords(withRecordIDs:in:completionHandler:)This deletes one or more records from the report. ...
                                                                                                                          Wherever you are is as good as
                                                                                                                          your workplace

                                                                                                                            Resources

                                                                                                                            Videos

                                                                                                                            Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                            eBooks

                                                                                                                            Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                            Webinars

                                                                                                                            Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                            CRM Tips

                                                                                                                            Make the most of Zoho CRM with these useful tips.



                                                                                                                              Zoho Show Resources