1 Reply Latest reply on Nov 22, 2009 1:33 PM by martinpaulrice

    Scripting question by beginner

    martinpaulrice

      Title

      Scripting question by beginner

      Post

      Hi, I'm a new user trying to teach myself to script in FM Pro 10 on an iMac running OSX 10.6.2. I have the following steps in my first script:
       

      If [Transactions::From Account Type = "Spending" and Transactions::To Account Type = "Expense"]Set Field [Budget::Current Balance; Budget::Current Balance + Transactions::Amount]End If

       


       
      What's missing is a second line after the if statement that would be something like:
       

      Set Field [Budget::Current Balance; Budget::Current Balance - Transactions::Amount]

       


       
      The problem, obviously, is that there are two account names associated with a given transaction, that is, one account name associated with the From Account Type and another account name associated with the To Account Type. One of them has to be incremented and the other decremented. And the next problem is that I don't know how to address them.
       
      The transactions table shows the Account Name and the Account Types, which I get from the related budget table. So I have access to them, but, as I said, I don't know how to address them in this script.
       
      Any help would be greatly appreciated.
       
      Thanks!