4 Replies Latest reply on Jan 28, 2015 7:12 PM by openspace

    Hiccup while Extending "Invoices" Starter Solution

    openspace

      Title

      Hiccup while Extending "Invoices" Starter Solution

      Post

      Hello, I'm new to filemaker and this forum, so please bear with me as I try to explain my issue.

      I have taken the "invoices" starter solution and extended it to handle donations made by customers.

      Donations Table: one person can make many donations, one donation can have many owners

      Therefore, I have three tables:

      Customers Table ----< CustomersDonations Table >----- Donations Table

      To add a donation I've created a portal in the customer details layout that views the CustomersDonations Table. When you add a line to the portal, it creates a new donation in the Donations Table. This is working perfectly. My issue arose when I tried to calculate the fiscal year within the donations table for a donation made by a customer.

      I noticed that:

      When a customer created a donation and created an invoice=the fiscal year was correct
      When a customer created a donation, but did not create an invoice=the fiscal year was incorrect

      I realize that the creator of this starter solution has triggered something to occur when an invoice is created, but I don't understand what I'm missing. I've also tried creating a field that calculates the fiscal year in the donation table. And again, when a customer has a donation and invoice the fiscal year appears and when the customer has a donation but no invoice the fiscal year fields are blank.

      My question is, why are the fields in the donations table appearing blank or incorrect when a customer doesn't have an invoice?

      Database: https://www.dropbox.com/s/3h8kgdkq8b0lv62/15%2001%2023%20db.fmp12.zip?dl=0

        • 1. Re: Hiccup while Extending "Invoices" Starter Solution
          philmodjunk

          Customers Table ----< CustomersDonations Table >----- Donations Table

          To add a donation I've created a portal in the customer details layout that views the CustomersDonations Table. When you add a line to the portal, it creates a new donation in the Donations Table.

          That doesn't add up. Either your portal is to the Donations table instead of the CustomerDonations Table or adding a line in the portal is really adding a new record to CustomerDonations not Donations.

          Telling us that you have modified a copy of "the invoices starter solution" doesn't tell us as much as you might think. Each version of FileMaker has a different version of this file. You modified the starter solution from which version of FileMaker?

          • 2. Re: Hiccup while Extending "Invoices" Starter Solution
            openspace

            Thanks for the reply! 

            I modified a copy from filemaker pro 13. I realize now that I have a field inside of the donations table that wants to calculate the fiscal year of each donation made this is referring to a field in company dashboard where the user can input the starting month of the company fiscal year. 

            I tried to make the field Company Dashboard::Fiscal Year Month global, but it still doesn't want to evaluate it. I wonder if it's how I'm writing my function? When I replace Company Dashboard::Fiscal Year Month with "04" (ie. April) the function evaluates perfectly. I would however prefer to call upon the global variable so the fiscal starting month can be customized by the user. 

             

            This calculation is being inside of the Donations Table. 

            Let (

            months = Month(Get(CurrentDate))  - Company Dashboard::Fiscal Year Month ;

            If( months > 0 ;

            Year (Get(CurrentDate)) & "–" & Right (Year (Get(CurrentDate))+1; 2);

            Year (Get(CurrentDate)) - 1 & "–" & Right (Year(Get(CurrentDate)) ; 2)
            )

            )

             

            • 3. Re: Hiccup while Extending "Invoices" Starter Solution
              philmodjunk

              If you specify global storage for Company Dashboard::Fiscal Year Month, and this is a field of type calculation, not a number or text field with an auto-enter calculation. This should work as you want it to. That will, BTW, turn this calculation field into an unstored calculation due to the reference to a global field.

              • 4. Re: Hiccup while Extending "Invoices" Starter Solution
                openspace

                Thanks! I actually wanted to keep that field as a text input field so it could be customized by the user. I ended up creating a TO that worked just as well.