6 Replies Latest reply on Jan 7, 2014 12:33 PM by Gilo

    relation test not running

    Gilo

      Title

      relation test not running

      Post

           Hi

            

           I've got 2 tables, client and clipart

           In clients I have a field "check" which tests something and gives me a 1 if it's true and a 0 if not

           In clipart I have 2 fields, one is a tester (value = 1) and the other is a ok sign.

           I established a relation between the two tables, where i say client:checke = clipart:tester

           And it nearly works fine, only if i change something, and check goes from 1 -> 0 or from 0 -> 1, the ok sign does not refresh. If I click "refresh window" then it does show me the right clipart.

            

           How do i manage that the clipart checks everytime something changes and gives me the right clipart?

        • 1. Re: relation test not running
          philmodjunk

               See if changing the value an d just clicking the layout background will refresh your system and show the correct image. Does it?

               If so, then you need to commit the change to your Client record after you change the value. This can be set up with a script trigger such that editing the field automatically commits that change back to the database.

          • 2. Re: relation test not running
            Gilo

                 Hi 

                 Well this does not work. I have the tester field, which has the formula 

                  

            Not IsEmpty ( FilterValues ( List ( Contracts::ContractType ) ; "Contract A" ) )

                  

            And i have the relationship which works when i manually refresh.

                  

            I've tried the script trigger SaveData with the script commit changes. But nothing happens (mine is in German so sorry for the wrong notions)

                  

            I've attached my DB maybe thats easier... (you have to change .jpg to .fmp12 - not sure if it works :-) )

            • 3. Re: relation test not running
              philmodjunk

                   What script trigger did you use? It's possible that the trigger was never tripped.

                   You cannot use Upload an image to share a database file, but you can upload an image to a file sharing site such as Drop Box and then post the download link in your comment.

              • 4. Re: relation test not running
                Gilo

                     here is the drop box link: https://www.dropbox.com/s/q24us6lxsuevfwv/test.fmp12

                      

                     Thank you so much

                • 5. Re: relation test not running
                  philmodjunk

                       I'm surprised by the results that I got here.

                       First, the wrong script trigger was set. You need to set the OnObjectSave trigger on the contrats::contrats_type field. Not OnCommitRecords on the layout.

                       But even with that correction, the image would not appear even though the calculation field was updating to show a 1 or 0 as expected.

                       I found two options that would work:

                       Make the trigger performed script do a Refresh WIndow [Flush cached join results] step

                       or

                       Change your match field from a calculation field to just a number field and use:

                       Set Field [ Clients::numberField ; not IsEmpty ( FilterValues ( List ( contrats::contrats_type ) ; "AUTO dommages" ) ) ]

                       in the trigger performed script to update the match field to 1 or 0.

                  • 6. Re: relation test not running
                    Gilo

                         wow

                          

                         great it works perfectly 

                          

                         Thanx