Wednesday, December 6, 2017

How to properly set Subforms in Zoho Creator Part 3

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;
Do not hesitate to contact me if you have any questions. I would be more than glad to help you buil an amazing online database application with Zoho Creator.

2 comments:

  1. Expenses Receipt - Best Receipt Maker - Receipt Generator - #1

    Expenses Receipt: Best Online Receipt Maker / Receipt Generator for custom receipts, choose the simple receipt template and itemized receipt template to make a free custom receipt maker. Make a receipt that looks like original.

    For More Info:- free receipt maker

    ReplyDelete
  2. Great guide! Setting up subforms in Zoho Creator can be a game-changer for businesses looking to manage complex data relationships efficiently. The way you've explained the process step-by-step makes it easy to understand how subforms can help create structured, organized forms for capturing multiple records in a single parent form. I especially appreciate the tips on customizing the layout and adding validation rules to ensure the data is captured correctly. For anyone looking to optimize their Zoho Creator experience, leveraging subforms can greatly enhance the overall usability of your app. Additionally, for more advanced customizations and personalized solutions, working with a Zoho Creator consultant can help you tailor the subforms to meet specific business needs.

    ReplyDelete