
Check all the options you have to transform your business
Schedule a Free 15 min Discovery Call
Or email us @ creatorscripts@zoho.com
This is the most important step in the process of setting up your zoho creator database. A properly linked setup will enable your information to run smoothly and avoid waisting space ( MB )
First, you need to create at least 2 Forms. For example.- Orders and Items. An Order can have multiple items and 1 item can be part of many Orders. Creating a many to many relationship.
Second, you need to add the Subform Items inside the Form Orders and name it. Then you have to add a Lookup field in the Items Form and click on Existing Relations.
Do NOT forget this part. This is the key. You must have a lookup field linking the original Form to each record on the subform you are creating. Makes Sense?
If it does not or need any help do not hesitate to contact us. We can guide you through the process to set your Subform for success.
To build a robust Order form in zoho creator you need to be able to automatically "fetch" the information about a product and let the system pre populate the subform with pre existing data in the Products Table.
First, you need to have a Products form with all the relevant information about the Product. Price, Description, etc.
Second, you need to fetch the Product information based "On user input" inside the items Subform and add the below deluge scripting.
prodct = Products [ID == row.Product];
row.Description = prodct.Description;
row.Price = prodct.Price;
row.Qty = 1;
if ((row.Price != null) && (row.Qty != null))
{
row.SubTotal = (row.Price * row.Qty);
}
The first step is to have the Subtotal or Total field value in the Order Form. Normally this would be a currency field or decimal field if you need to consider 1 or more decimals into your calculations. If not you can also set it the field as a Numeric value field. Our example uses a currency field.
Second you need to think about the places where the script to aggregate the rows needs to occur. in our case there are several places. On Add Row, On Selecting a new Product, On Changing the Qty amount or the pricing. Its important that all scenarios are considered otherwise your calculations may not be properly aggregated if it encounters a scenario that you have not considered in your scripting yet.
Last but not least, the script below is ready for you to copy and paste into your application. Assuming of course that the field names of your Order Form are named exactly as our test application.
if ((row.Price != null) && (row.Qty != null))
{
row.SubTotal = (row.Price * row.Qty);
}
t = 0.0;
if ((row.Price != null) && (row.Qty != null))
{ for each rec in Item_Details
{ t = (rec.SubTotal + t);
}
}
input.Subtotal = t;
There are 3 different ways to visualise your Zoho Creator subform data. Two different ways to present the information on a view and 1 way to display it on a summary template.
Application development in Zoho Creator, Support and Deployment of other SaaS solutions including Zoho CRM, Zoho Projects & Zoho Books
This is not a traditional developer course or software website with hard to understand scripts. Deconstructing Zoho is an uncommon approach to learn online database programming. We focus on 20% of the commands that produce 80% of the performance.
Subforms are one of the most important steps in the process of setting up your zoho creator database. A properly linked subform setup will enable your information to run smoothly and avoid wasted space ( MB )