Update Income & Expense (form field)

Update Income & Expense (form field)

Hi,


I am trying follow this example:

URL:   https://creator.zoho.com/help/deluge/result_doc.jsp?url=functions-code-tt.html&query=update%20field#updateincome


I create a functions and I have this code:


=======

void updateincome()
        {
            x = 0;
            for each rec in Add_Income
            {
                x = (x + rec.Amount);
            }
            aih  =  Add_Account  [ID != 0];
            aih.Ac_Amount = x;
        }

void updateexpense()
        {
            x = 0;
            for each rec in Add_Expenses
            {
                x = (x + rec.Amount);
            }
            aih  =  Add_Account  [ID != 0];
            aih.Ac_Amount = x;
        }

=======


But I am getting this error:


==
Error in statement at line number 6
The template variable x is of type BIGINT. But you are trying to update it with an expression of type DECIMAL
==


Can you help me?



Thank you!