Call a function on Field Action , On User Input

Call a function on Field Action , On User Input

Could someone help please?

I have this function which works fine on test:

 void workorder.UsedQty(Work_Orders workorder)
{
    for each recRow in workorder.Pick_Items
    {
        Item_Name  =  Maintenance_Item  [ID == recRow.Item_Name];



        Item_Name.Qty_on_Hand = recRow.Qty_Remaining;

    }

}

But when I want to set variable or call this function, I get the error “UsedQty is not a valid function”

I am trying to call this function after a Field Action , On User Input , script as follows which works fine as well.

row.Qty_Remaining = (row.Qty_Available  -  row.Qty_Used);

I am new in Zoho Deluge - Please let me know the step by step of calling above function to update the form field.

Any Help will be appreciated.


Thanks
Reza