Passing Form Objects as argument
A Form Object represents a collection of records. Zoho Creator supports passing of Form Objects as an argument to a user-defined Function.
To pass Form Objects as arguments, select the required Form under Form Object and specify a name for it in the Specify Arguments section.
In the following function named "calculateNetPay", emp is the form object which represents a collection of records in Employee Form. This form object is passed as argument to the function to process the employee records by iterating the collection.
Void calculateNetPay(Employee emp)
{
for each emp1 in emp
{
emp1.NetPay=(emp1.BasicPay+emp1.HRA)-(emp1.PF+emp1.TAX);
}
}
{
for each emp1 in emp
{
emp1.NetPay=(emp1.BasicPay+emp1.HRA)-(emp1.PF+emp1.TAX);
}
}
