Update an existing record using stateless forms

Update an existing record using stateless forms

Requirement  

Use details specified in a stateless form to modify records in the main form.

Use Case  

In an order management system, a customer has placed an order and wants to cancel it. The administrators allow for cancellation by accepting the reason and updating the same in the current record. However, the other fields cannot be updated. So, we get the values of the required fields for cancellation and update the main order record.

Steps to follow  

1. Create the forms with the following details:
Form
Form Link Name
Field Type
Field Name
Field Link Name
New Order
New_Order
Email
Contact Email
Contact_Email
Date
Order Date
Order_Date
Subform
  • Single Line
  • Number
  • Currency
  • Currency
Products
  • Product Name
  • Quantity
  • Rate
  • Sub-Total
Products
  • Product_Name
  • Quantity
  • Rate
  • Sub_Total
 
Currency
Total
Total
Drop Down
  • Pending
  • Ready to Deliver
  • Delivered
  • Cancelled
Order Status
Order_Status
Date
Cancellation Date
Cancellation_Date
Multi-line
Reason
Reason
Cancellation
Cancellation ( Duplicate this form to create a stateless form named Cancel Request )
Date ( Initial Value : zoho.currentdate )
Cancellation Date
Cancellation_Date
Number
Order ID
Order_ID
Multi-line
Reason (Mandatory)
 
Reason

Mark the
Order Status field as admin only We shall add the
  • Cancellation Date  
  • Reason fields
to the New Order form to a section named Cancellation.
 
2. Let's create a workflow to execute during the load of the New Order form to hide the Cancellation section.
 
3. Add the below code in the Deluge Editor:
  1. hide Cancellation; 

4. We will display Cancel Request form when the customer chooses to cancel an order placed. So, let's hide this form from sections.
 
5. Only the user who placed an order can cancel one. This is why we are creating a report to list only those orders created by the logged-in user. Create a list report from the New Order form and name it as Your Orders.
 
6. Add a filter to the Your Orders report to display only the orders for the current login user and active orders - with Order Status value Pending or Ready to Deliver or Delivered.
 
7. Next, let's add a report workflow to allow for the customers to cancel an order. Click on the My Orders report. Navigate to Quick View > Add Field > Add New Button. Name the Action Item as 'Cancel Order'.
 
8. An order can be cancelled if it is not delivered. So, set the criteria to show the action item if the Order Status value is not Delivered.
 
9. We shall execute this action item after confirmation. Add a confirmation message accordingly as below.
 
10. Name the workflow as 'cancelOrder' and click Create Workflow.
 
11. Click Add New Action > Deluge Script > Create your own. Add the below deluge code to open the stateless form Cancel Request in a popup window with the Order ID value equal to the current record ID. This is done to ensure the correct order is cancelled by the user.
  1. openUrl( "#Form:Cancel_Request?Order_ID=" + ID, "popup window", "height=300px,width=300px");

12. Click Create. This will create the action item.

Now that the report workflow is configured, let us configure the functioning of the Cancel Request stateless form.
 
13. Let's create a workflow on the load of the Cancel Request to disable the Cancellation Date and hide the Order ID fields so that they are not modified.
 
14. Click on Add New Action and add the below script to disable the Cancellation Date and hide the Order ID fields.
  1. disable Cancellation_Date;
  2. hide Order_ID; 

15. Once this Cancel Request form is filled and submitted, the corresponding New Order record should be updated too. W e shall create a workflow to execute when the Submit button is clicked on the Cancel Request form.
 
16. Click Add New Action > Deluge Script. Add the below Deluge Script in the editor:
  1. //Closing the Cancel Request stateless form popup
  2. openUrl("#Script:page.parent.refresh ","parent window");

  3. //Get the corresponding New Order record
  4. order = New_Order[ID == input.Order_ID];

  5. //Update the Reason field
  6. order.Reason=input.Reason;

  7. //Update the Cancellation Date field
  8. order.Cancellation_Date=input.Cancellation_Date;

  9. //Update the Order Status to Cancelled
  10. order.Order_Status = "Cancelled";

17. Additionally, we can create a report to show the cancelled orders alone too. Create a list report named Cancelled Orders from the New Order form.
 
18. Add a filter to the Your Orders report to display only the cancelled orders.

See how it works                

Points to Note  

  • Instead of a stateless form to get the necessary details, we can open the New Order record and disable or hide the other fields, as well. We can create a workflow and during the edit of a record, we can disable or hide all the other fields except Cancellation section like this:
 
And add the below code in Deluge editor:
  1. disable Contact_Email;
  2. disable Order_Date;
  3. disable Delivery_Date;
  4. disable Total;
  5. disable Taxes;
  6. disable Net_Total;
  7. disable Order_Status;

  8. //Hide the subform
  9. hide Products;

  10. //Show the cancellation section
  11. show Cancellation; 
              





      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 FormsLegalMobile App
                              Form DesignerHRMobile 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 FormsEncrypted Forms

                              Secure 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

                                                              Use cases

                                                              Make the most of Zoho Desk with the use cases.

                                                               
                                                                

                                                              eBooks

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

                                                               
                                                                

                                                              Videos

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

                                                               
                                                                

                                                              Webinar

                                                              Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                               
                                                                
                                                              • Desk Community Learning Series


                                                              • Meetups


                                                              • Ask the Experts


                                                              • Kbase


                                                              • Resources


                                                              • Glossary


                                                              • Desk Marketplace


                                                              • MVP Corner

                                                                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

                                                                                                                        • Update a form using custom action (from another form's report)

                                                                                                                          Requirement   Update a form using a custom action configured in another form's report. Use Case In an engineering college student management application, a student may withdraw at any time of the academic year. Whenever a student applies for ...
                                                                                                                        • FAQ: Stateless Form

                                                                                                                          This page covers essential insights on Zoho Creator, including stateless form creation, optimized workflows linked to submissions, and the seamless process of creating forms without reports. What are stateless forms in Zoho Creator? Stateless forms ...
                                                                                                                        • FAQs: Form Buttons

                                                                                                                          This page covers about the functionality, customization, and optimization of form buttons in Zoho Creator, answering key questions and providing insights for enhancing user experience. What are form buttons in Zoho Creator? Form buttons in Zoho ...
                                                                                                                        • Understanding form builder

                                                                                                                          What does this page cover? Learn more about the form builder and how you can customize your form and its fields according to your business needs. Availability Forms built from scratch, by importing data, and from a template can be created in all ...
                                                                                                                        • Disable Custom Actions after n times

                                                                                                                          Requirement  A custom action on a report has to be disabled after it is triggered three times. Use Case  We have an app to maintain customer invoices. After an invoice is created, the staff can email the invoice to the customer with the click of a ...
                                                                                                                          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