3 Replies Latest reply on Nov 6, 2013 8:09 AM by philmodjunk

    Container field not updating

    johnswhitehead_1

      Title

      Container field not updating

      Post

           Hi

           I have a number of problems using graphics in container fields related to data in other tables. It's a technique I've used successfully in the past but it has come severely unstuck this time.

           I have a table called icons that has two fields, value and icon. It has two records with values 0 and 1 and icons of a red cross and a green tick respectively.

           In other tables (in a very complex database) I have flags that indicate whether a process has been completed. These are set at 0 initially and changed to 1 when the appropriate criteria have been met. Instead of displaying 0 and 1 I want to show the information using the graphics in the icons table so I set up a separate TO of icons for each flag, related to the substantive table by linking the flag field to the value field in the icon record.

           This doesn't work. Specifically, I can change the value of the flag from 0 to 1 or in the other direction and nothing happens to the icon display. I have tried changing the container field's status from optimized for images to optimized for interactive with no effect. I have checked that the calculations of the flags result in numbers not text. I have tried putting Commit records steps into the scripts at appropriate times with no effect. I have Recovered the file but no corruption was found and the new file behaves in the same way. The only way I have found to get the icon to update is to go into Manage Database and perform an action on the icon TO (just moving the graphic of the TO in the relationship table will do the job).

           If instead of setting the flag to zero initially I instead leave it blank, then the icon will update when a value is added. But, weirdly, when this happens to one record in a portal it changes the icon in all (or at least both) records in the portal.

           I have made a very simple database using the technique and it works fine. What is it that's messing with the relationships? 

           The really bizarre thing (that prompted me to do the recovery) is that I gave up and made a container field in the substantive table with a lookup into the icon table via the relationship with the flag. This doesn't work either, with an attempt to relookup the value met with an error to the effect that there are no fields that are looked up via that flag.

           Any ideas? I'm baffled.

           Thanks

        • 1. Re: Container field not updating
          philmodjunk
               

                    But, weirdly, when this happens to one record in a portal it changes the icon in all (or at least both) records in the portal.

               I would suspect then that the field in the portal row is from the wrong table occurrence. It should be from a table occurrence that is directly related to the portal's table occurrence and not the layout's table occurrence.

               Your other issues may also stem from selecting the container field from the wrong table occurrence but that's just a guess on my part.

          • 2. Re: Container field not updating
            johnswhitehead_1

                 Phil

                 You were absolutely correct about the portal: it was an indirect rather than direct link. Easily sorted, thanks.

                 I finally found the solution to the other problems as well. I inserted a Refresh Window step with the flush cache options set on, and that has sorted it. It needed some encouragement to update the links, and that obviously provides it.

                 Thanks for your help.

            • 3. Re: Container field not updating
              philmodjunk
                   

                        I inserted a Refresh Window step with the flush cache options set on,

                   That really shouldn't be necessary and can result in long delays while waiting for the screen to refresh in some situations.