1 Reply Latest reply on Aug 31, 2009 10:39 AM by philmodjunk

    GTRR behavior needs to be like it was in 6

    jbarnum

      Summary

      GTRR behavior needs to be like it was in 6

      Description of the issue

      In FileMaker 3 through 6, if you do 'Go to Related Record' and there are no related records, it takes you to an empty found set in the correct destination layout. This seems to be like the obvious expected behavior. In FileMaker 7 and later, the behavior is to do nothing if there are no related records. This leads to nothing but problems. Can we please have the old behavior back? For example, if I want to delete all related records, I can't just do: GTRRDelete all records (no dialog) This could potentially delete every record in the parent table instead of the child. Sure, you can add an If IsEmpty() check around that, but this is a pretty serious problem that won't manifest in development (because you'll probably have related children records in testing). Furthermore, it's a pain in the butt if you want to actually take the user to the related table with an empty found set. You would have to do something like this: If( IsEmpty(related key) )Go to child layoutGo to first recordOmit multiple ( Get(FoundCount) ) ElseGTRREnd If  Conversely, if you want the 7+ behavior as it stands now, it's really easy, and much less prone to accidental mess-ups, just do the same If IsEmpty() check and then don't do the GTRR if the related field is empty. 

        • 1. Re: GTRR behavior needs to be like it was in 6
          philmodjunk
            

          You're not the first to complain. I've thought the same ever since I stumbled into the various undocumented incosistencies.

           

          Interestingly, you CAN get GTRR v6 behaviour in one special case. If you are working with a self join, use GTRR with the current layout option and you'll get the original no match = zero found set behavior.

           

          Otherwise, you have to use either a test such as isempty(relatedtable::Keyfield) just before the GTRR or Get ( LastError ) just after the GTRR to avoid potential catastrophe.

           

          Note that GTRR also has "special" features when triggered when a portal row has the focus and the Portal uses the same relationship. In that case, the current row of the portal will be used to make that record the current record of the found set GTRR generates. However, if the current portal row is empty (bottom row in a portal where you can add new records.), you get the same "no match = no change in layout/found set" behavior as when there are no matching records at all in the general case. (The key difference here is now you can have matching related records in the portal but GTRR still fails because there is no record in the active row to select.)