4 Replies Latest reply on Jul 15, 2015 9:56 AM by simonbucknall

    scripting Value Lists

    simonbucknall

      Title

      scripting Value Lists

      Post

      Hi,

      I am new to filemaker so please accept my apologies for my ignorance.

       

       

       

      I have been trying to work out a solution to this for a while and seem to be getting nowhere.

      I have a portal in a customers layout the shows their previous and upcoming bookings. We are only at their site on set dates so I want to auto update a 'visit date' value list with the dates we are attending their site using a script trigger.  From this i can then script to update the booking with all the details for the future visit date.

      I hope this makes sense, I thought this would be a simple thing to do so suspect i am missing something very obvious.

      Thanks for any help/thoughts you can  offer.

      Simon

       

        • 1. Re: scripting Value Lists
          philmodjunk

          You'll need to describe your current design in more detail.

          I want to auto update a 'visit date' value list with the dates we are attending their site using a script trigger.

          How exactly are you entering or selecting these dates? Are you creating records in a table of "visit dates" or something else?

          • 2. Re: scripting Value Lists
            simonbucknall

            Hi Phil,

             

            Many thanks for responding to my question, it is very much appreciated.

            I have attached the relationship diagram to give you a better idea of the data structure. 

            The layout is based on the 'Customers Bikes' table and the portal is based on the 'Bike Service Bookings'  table. The visit date field in the portal is from the 'Service Visit' table.

            My Plan was to have a button that opened a popup with a 'script trigger on open' that would set a variable to the 'site code' for the booking, then go to the 'Sites Visit' table perform a find for the sites code and then populate the Value list 'visit dates' with the Visit dates in the found set.

            In the popup I was intending to have the visit date box with dropdown values from the 'visit dates'  value list and an 'on modify' script trigger to then amend the 'bike service booking' record with the new information.

            What I can't seem to be able to do is populate a value list from a found set - is there a script i am missing or is this not a simple as i had assumed?

            I hope this is a little clearer now, 

            Many thanks,

            Simon

             

             

             

             

            • 3. Re: scripting Value Lists
              philmodjunk

              It's possible, but maybe a more complicated approach than you really need.

              You have these relevant relationships:

              CustomerBikes----<BikeServicebookings>--------ServiceVisits

              If you modified that to add another Tutorial: What are Table Occurrences? of ServiceVisits like this:

              BikeServicebookings>--------ServiceVisits------<ServiceVisits|SameSite

              with match fields like this:

              ServiceVists::SiteCode = ServiceVisits|SameSite::SiteCode AND
              ServiceVisits::cToday < ServiceVisits|SameSite::VisitDate

              You could define a "use values from field" value list of dates from ServiceVisits|SameSite::VisitDate and specify the "include only related values starting from BikeServicebookings to get a value list of dates today or later for the same site. This produces the value list that you describe here without the need for the scripted find.

              cToday would be an unstored calculation field defined with this expression: get ( CurrentDate ) and is used to omit dates from the past that might be found for a given site in your ServiceVisits table.

              But if you still would like to use a scripted find to set up your conditional value list, you can find examples of that in:

              "Adventures in FileMaking #1 - Conditional Value Lists"

              • 4. Re: scripting Value Lists
                simonbucknall

                Thanks Phil,

                It will take me a while to get my head around this but thank you very much,

                I will try to get this working tonight/tomorrow.

                Simon