I am trying to create a very simple budget application. When I submit a purchase in my Add_Purchase form, I want to send the Cost of that purchase to a form that tracks the Expense Account. In the Expense Account form I already have the budgeted amount for the year and I have a remaining balance formula field that will take the Budgeted_Amount and subtract the Amount_Spent from it. However, I cannot get the purchases once submitted, to shoot that Cost over to add into the Amount_Spent. Instead, the Amount_Spent in the Expense Account form remains blank. Also when submitting the purchase I get an Error on Success script: Unable to update data on the form variable. temp.Amount_Spent is null temp is null
Going off of another budgeting application I found on the forum I've tried to change it to what I need but it's not working.
- temp = Add_Expense_Account [Account_Number == input.Expense_Account];
- temp.Amount_Spent = (temp.Amount_Spent + input.Cost);
- temp.Remaining_Balance = (input.Expense_Account.Budgeted_Amount - input.Expense_Account.Amount_Spent);
- input.Balance = temp.Remaining_Balance;