3 Replies Latest reply on Mar 28, 2015 8:10 AM by philmodjunk

    How to Automatically update text field after updating another field

    WeirdMan

      Title

      How to Automatically update text field after updating another field

      Post

      Hi, I'm trying to create a solution based on invoices template from FileMaker 12. I'm trying to add payment dates for multiple payment of an invoice. How can I update Payment Status field instantly after I'm updating a portal field? I have tried script triggers (modify, validate, save, exit, all at once and one by one) on every portal fields and buttons to update  Payment Status and it make my computer hang after I select object outside portal. Possibly because I use keyboard navigating instead of mouse pointer navigating.

      I tried to add script trigger on layout enter, keystroke, exit to update Payment Status field, but it will not update field when Filemaker crashed (or forced to quit) when inside that layout, so I can't use this solution.

      I tried to use calculation field, but it will show double on Customer Details layout portal. Even if I use this solution, I doubt it can handle large data because it have to calculate all invoices.

      So, as title says, how to automatically update text field every time I update another field (in a portal)?

        • 1. Re: How to Automatically update text field after updating another field
          philmodjunk

          How can I update Payment Status field instantly after I'm updating a portal field?

          Your script trigger method should work, but chances are that your current method is tripping it's own trigger and thus getting trapped in an infinite loop. Exactly why that is happening depends on what triggers you use and what your script does. There are also ways to set a value in a global variable that then keeps the triggered script from performing a second time.

          But a simpler approach that should work is an unstored calculation field defined in Invoices. This method shouldn't "show double" and doesn't require calculating on "all invoices"--just the payment records linked to a given invoice--which should be a fairly small number of related records, but then you haven't explained where a "customer details" layout comes into this either...

          • 2. Re: How to Automatically update text field after updating another field
            WeirdMan

            My bad, since invoices template is in Filemaker templates since I use FM on FM11, I did not explain it properly. I will upload 2 images for explaining what happened if I use a calculation fieldThe button on Paid Invoices portal is visible and clickable, and have same destination with invoice in Unpaid Invoices portal.

             

            This is the field I filtered in previous image portals.

            Is there something wrong with my setup?

            EDIT: removed unecessary image

            • 3. Re: How to Automatically update text field after updating another field
              philmodjunk

              I see nothing in your last post that changes what I said previously. Keep in mind that it's how the table occurrences in your database, starting with the ones set up for your calculation field's "context (Invoices), the layout (layout setup | Show Records from ) and your portals (Portal Setup | Show Related Records From) link to other tables in Manage | database | Relationships that play a crucial role in how such calculations evaluate.