Create Serial Number for subform rows

Create Serial Number for subform rows

Requirement

Create serial numbers or auto-numbers for subform rows when a new row is added.

Use Case

In an employee management system, an employee can add up to five dependents. It will be easy for the employees if the dependents added in the subform are numbered automatically.
 

Steps to follow

1. Create the forms with the following details:
Form
Form Link Name
Field Type
Field Name
Field Link Name
Add Dependents
Add_Dependents
Number
S.No
S_No
Name
N ame
Name
Drop down
Relationship
Relationship
Date
Date Of Birth
Date_Of_Birth
Add Employee
Add_Employee
Name
Name
Name
Email
Official Email
Official_Email
Radio
Gender
Gender
Subform (Add Dependents)
D ependents - You can add upto 5 Dependents.
Dependents
 
Multiple fields can be added to the Add Employee form. We have added a smaller number for brevity.
 
 
3. Now, let's create a workflow to disable the S.No field in the Add Dependents subform during the load of the Add Employee form.
 
4. Add the below Deluge code in the editor:
  1. disable Dependents.S_No;

5. Now, let's create a workflow to calculate the serial number for the subform rows.


6. Add the below code in the Deluge editor:
  1. //Set the number of subform rows to 0
  2. recCount = input.Dependents.count();
  3. // Inform the employee that only 5 dependents can be added
  4. if( recCount == 5 )
  5. {
  6.   alert "This is the last dependent you can add. Please note that if you want to add a dependent, you have to remove one.";
  7. }
  8. //Set the current row's S.No value to the recCount
  9. row.S_No =recCount;
When a new subform row is added, the S.No field gets populated.

See how it works

 

Points to Note

  • Auto-number fields are not allowed inside subforms, so that there is no confusions when subform records are inserted. 

    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


          Get started with Zoho Sign

          in a few quick steps!

          Download Help Guide





                    Still can't find what you're looking for?

                    Write to us: support@zohoforms.com


                          



                          





                        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 SalesIQ Resources



                                            Zoho TeamInbox Resources



                                                    Zoho DataPrep 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

                                                                              • Add subform rows with dynamic data from another subform

                                                                                Requirement             Automatically add rows to a subform and populate it with dynamic data fetched from another subform. Use Case   A form named Orders Database contains customer details and their frequent orders in a subform. We have another ...
                                                                              • Display subform's report in parent form's report

                                                                                Requirement   When the user views a particular record in a report that has subform, the values in the corresponding records are also shown. Use Case   An order management application contains two forms: Customers and Orders. The Customer s form is ...
                                                                              • Auto-calculating values on a subform's field

                                                                                Requirement Perform statistical operations on the numerical fields in subforms for analysis. Use Case  In an order management application, there are two forms, Order and Product. The Product form lists all the products in the inventory and the Order ...
                                                                              • Communicate stakeholders about an out-of-stock situation without manual intervention

                                                                                Requirement   When an item runs out of stock, send an automated email to the vendor, and alert the customer that the item is not available. Send an alert to the customer when the item gets restocked. Use Case   In an order or inventory management ...
                                                                              • Create a search functionality to dynamically filter a report

                                                                                Requirement Create a search functionality for users to find specific records based on their search queries. Use Case An order management app is used by a business to store its customer details, and by billing agents to order products. There are three ...
                                                                              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