2 Replies Latest reply on Jun 10, 2013 10:59 AM by daniel.castro

    Pop-up Menu with Conditional Value List Won't Refresh


      Hi all,


      I've been stuck on this problem for about 8 hours now and I am at a loss on how to get what I imagine is a simple task working. Here is what I am trying to achieve.


      The database tracks movie data. Users assign a director using a pop-up menu. I have a table of people and roles (a person can have many roles). I have a working conditional value list that returns a list of all people with the role of director and the menu displays correctly. However, if the director is missing, the user can navigate to a new layout to create a new person or assign the role of director to an existing person. When they nagivate to the previous layout to assign the director again, the menu doesn't display the newly assigned director.


      I've paired down the situation into the attached test database.


      In my example, the movie is Gran Torino. The director is incorrectly assigned to John Ford. The menu correctly shows only John Ford and Sergio Leone, despite the people in the database include Clint Eastwood and John Wayne, so the conditional value list appears to be working. Nagivate to the PersonRoles layout and assign Clint Eastwood the role of Director. Navigate back to Main and try to assign Clint Eastwood as the director. He is not in the list. Click each Refresh button (every combination) and the list will not refresh. You can close the database and open it and Clint Eastwood will be in the list. Additionally, any changes made to the relationships graph which requires a save will actually cause the list to refresh.


      Here are all the things I tried:

      Refresh Window (all combinations of flush cached results and external data) - just to test as I have read about the negative impact of this method.

      Cartesian joins between all the tables I could think of.

      Regular joins between the appropriate tables and fields.


      I'm a seasoned software engineer and I've only been working in FMP for about a month now. I must be doing something wrong, but I can not see what it is.


      Any help is greatly appreciated!






        • 1. Re: Pop-up Menu with Conditional Value List Won't Refresh

          Daniel: Welcome to FileMaker!


          You may be overthinking this a bit. It seems that your primary issues is that you don't have your primary keys automatically set. As it is when one creates a new person it's up to the user to assign a key; if that doesn't get set then relationships won't exist and your popup won't work. Change all keys fields to auto-enter a calc (and I would recommend against using serial numbers - they're not that robust in the long run). When a key exists and the user goes to the third layout to assign a role then back to the main layout the popup works fine.


          You may also want to consider why you're having the user go to the third layout to assign a role; that can be done in the person's record directly.


          Good luck!

          • 2. Re: Pop-up Menu with Conditional Value List Won't Refresh



            Yes, the example I uploaded didn't have the primary keys set properly as it was just a quick and dirty way to demonstrate the issue. I added the primary keys as they would normally be defined and it had no effect on the issue. However, as it is a new day and I had a couple of days off from the problem, I was able to gain new perspective this morning and actually did find the solution.


            This is my interpretation of the situation. The conditional value list was not being notified of the "change" to the list. FMP relies heavily on the relationship graph to "manage" the querying/caching of related data. The change to the list was actually being performed on the table instance called PersonRoles, while my CVL was dependent on the Directors 1 and Directors 2 table instances. I removed Directors 1 and related PersonRoles::PersonId to Directors 2::DirectorId. I updated the CVL to use PersonRoles for it's value and Directors 2 for it's text and it worked.


            I made the necessary adjustments in the real application and it too worked.


            The key for me, was to think of the table instances as objects and FMP using internal events to manage the caching of the value list. The "data change" event was being triggered by the PersonRoles table instance, while the CVL was "listening" for events on the Person table instance.


            I don't know if this interpretation is 100% correct, just my assessment from observed behavior. But it seems to be working and I can move forward to the next challenge.



            Thanks for your help!