Developing Application in ZOHO Creator (Tutorial And Script)

Page 1

Developing Application in ZOHO Creator Aditya Zutshi, MBA I Year, Vinod Gupta School of Management, IIT Kharagpur Problem Statement: Your company sells a fixed number of items each of which has a fixed price and at any point of time there is a certain quantity of each item in the inventory. Your salespersons are out in the market and meet clients to pick up orders. They can pick up an order if and only if the required amount is available in the inventory. When an order is picked up the quantity in the inventory has to be reduced. If the order falls below a certain quantity, a re-stocking mail has to be generated. After an order is placed, cash has to be collected against the order. Once the cash is collected, the order is tagged is paid. As the owner-manager you would like to know what are the orders that have been placed, what is the inventory? What is the accounts receivable position?

Step 1: Create an application.


Step 2: Import Data by clicking on the Import XLS Green Button. You can import an excel sheet or paste the tabular data directly.

Step 3: Make a Form by dragging and dropping page elements as required from the left column.


Step 4: Click on the “Script� Tab on the top. You can add your script for different events. Step 5: For Order to Cash Application, under the on Add event, on Load, you can mention the fields that you want to be visible, hidden, enabled or hidden. In the Validate mention the validations and in the On Success mention the action you want on success.

For my application, the script is as follows: On Load: hide Quantity_Available; hide Salesperson_Name; hide Reorder_Point; hide Quantity_to_Order; hide Product_Price; hide ClientsName; hide Product_ID; disable Product_ID; disable Product_Price; disable Quantity_Available; disable Reorder_Point; disable Quantity_to_Order; disable ClientsName; disable Salesperson_Name; Validate: if (input.Quantity_to_Order > input.Quantity_Available) { alert "You don't have enough stock. You can buy only " + input.Quantity_Available + " items"; cancel submit;


} else { alert "Your order has been placed. Transaction Successful. A record has been created in the Order Book and the stock has been updated in Order To Cash Form."; } On Success: price = input.Product_Price; quant = input.Quantity_to_Order; col = Order_To_Cash_Form [Product_Name == input.Product_Name]; if (input.Quantity_to_Order <= input.Quantity_Available) { new_avb = (input.Quantity_Available - input.Quantity_to_Order); col.Quantity_Available = new_avb; if (col.Quantity_Available <= col.Reorder_Point) { col.Quantity_Available = (col.Quantity_Available + 30); } amount = (price * quant); insert into Order_Book [ Added_User = zoho.loginuser Client_s_Name = input.ClientsName Date_field = zoho.currentdate


Payment_Status = "Not Paid" Product_ID = input.Product_ID Purchase_Amount = amount Quantity = input.Quantity_to_Order Salesperson_Name = input.Salesperson_Name ] delete from Order_To_Cash_Form[ ClientsName == input.ClientsName ]; success message "Order placed.Records Created & Updated"; } Step 6: In the Field Actions, you can script how the applications behaves when the user enters an input.


The script for my application is as follows: if (input.Product_Name == "Lux Soap") { show Product_ID; show Product_Price; show Quantity_Available; show ClientsName; show Salesperson_Name; show Quantity_to_Order; Current = Order_To_Cash_Form [Product_Name == input.Product_Name]; input.Product_ID = Current.Product_ID; input.Product_Price = Current.Product_Price; input.Quantity_Available = Current.Quantity_Available; input.Reorder_Point = Current.Reorder_Point; enable Quantity_to_Order; enable ClientsName; enable Salesperson_Name; } if (input.Product_Name == "Head & Shoulders Shampoo") { show Product_ID; show Product_Price; show Quantity_Available;


show ClientsName; show Salesperson_Name; show Quantity_to_Order; Current = Order_To_Cash_Form [Product_Name == input.Product_Name]; input.Product_ID = Current.Product_ID; input.Product_Price = Current.Product_Price; input.Quantity_Available = Current.Quantity_Available; input.Reorder_Point = Current.Reorder_Point; enable Quantity_to_Order; enable ClientsName; enable Salesperson_Name; } if (input.Product_Name == "AXE Deo") { show Product_ID; show Product_Price; show Quantity_Available; show ClientsName; show Salesperson_Name; show Quantity_to_Order; Current = Order_To_Cash_Form [Product_Name == input.Product_Name]; input.Product_ID = Current.Product_ID; input.Product_Price = Current.Product_Price;


input.Quantity_Available = Current.Quantity_Available; input.Reorder_Point = Current.Reorder_Point; enable Quantity_to_Order; enable ClientsName; enable Salesperson_Name; } if (input.Product_Name == "Garnier Creame") { show Product_ID; show Product_Price; show Quantity_Available; show ClientsName; show Salesperson_Name; show Quantity_to_Order; Current = Order_To_Cash_Form [Product_Name == input.Product_Name]; input.Product_ID = Current.Product_ID; input.Product_Price = Current.Product_Price; input.Quantity_Available = Current.Quantity_Available; input.Reorder_Point = Current.Reorder_Point; enable Quantity_to_Order; enable ClientsName; enable Salesperson_Name; }


if (input.Product_Name == "Pepsodent Toothpaste") { show Product_ID; show Product_Price; show Quantity_Available; show ClientsName; show Salesperson_Name; show Quantity_to_Order; Current = Order_To_Cash_Form [Product_Name == input.Product_Name]; input.Product_ID = Current.Product_ID; input.Product_Price = Current.Product_Price; input.Quantity_Available = Current.Quantity_Available; input.Reorder_Point = Current.Reorder_Point; enable Quantity_to_Order; enable ClientsName; enable Salesperson_Name; }


Step 7: Once you have finished the scripting, click on the “Share� Tab on the top and make the application public. Step 9: Get the embed code and publish it on your blog!

Step 10: And the final application looks like this:

Product Name * Product ID Product Price Quantity Available Client's Name Salesperson Name Quantity to Order Powered by

Submit

Reset

My application is running on: http://www.adityazutshi.com/2010/03/order-to-cash-application-sales.html View the application with this tutorial. Good Luck!


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.