4 Replies Latest reply on Apr 14, 2014 7:00 PM by symbister

    Expecting instant update, but doesn't...



      Expecting instant update, but doesn't...



           I have one central table 'picacontax', with two TO's - Similars and Similar_Organisations (idea purloined from starter Email Campaign Management) so that a contact's record has a portal to Similars, listing others from same organisation, but excluding that contact.

           In picacontax, I count the number of contacts who receive our newsletter (PICAGuide = Yes), using a calc field:

           Count ( similar_organisation::PICA_Guide )

           so that I can display on the contacts record how many Guides are sent to that org.

           OK, but if I change the PICA_guide tag on the contact's record, the portal row doesn't update instantly, have to exit the record and come back to it to see the effect. I've tried a Commit records trigger in the PICA_guide field on the record, but it seems that I should try and commit records in the other TO's somehow?

           I hope I've explained this clearly enough .... screenshots herewith..


        • 1. Re: Expecting instant update, but doesn't...

               Try a Refresh Window [Flushed cached join results] script step, to be triggered OnObjectValidate.

          • 2. Re: Expecting instant update, but doesn't...

                 Phil, on this same topic, I've only recently played with using Refresh Window to update portals. I was using it in a script that was triggered on exiting a field. Normally, tabbing out of the field would take the cursor to the next field in the tab order, but in on particular instance, I wanted the script to recirculate to the beginning of the tab order.

                 The issue I had was getting the cursor into a field of my choosing after the script ran. I finally used a SetVariable to pre-set the object name for what the next field should be. However, even when I used the GoToObject script step, I still had to finish the script off with an ExitScript [False] in order to stop the cursor from going to the field it would have gone to in the tab order.

                 This is only for a very specific use of a multi-use script, but the bottom line is the use of "false" as a script result to ensure which field is active after the script has run. Is there a better way, in general?

            • 3. Re: Expecting instant update, but doesn't...

                   Take a look at the table in "Setting up script triggers" in FileMaker help. Certain script triggers perform their assigned script before the triggering event is processed. Others perform the script after the event is processed. For triggers that perform the script before the event, exit script [false] is the documented method for keeping the triggering event from being processed.

                   The classic example is to use exit script [false] in a script performed by the OnObjectExit trigger to put the cursor in a different field than the one specified by the layout's tab order--which would appear to be what you report here.

                   But this post does not appear to apply to the issue opened by Symbister. It seems a new issue that should be in a thread all its own.

              • 4. Re: Expecting instant update, but doesn't...

                     thanks Phil_1986

                     works fine - just changed trigger to OnObjectModify..