10 Replies Latest reply on Sep 20, 2012 12:31 PM by gdurniak

    Possible to script the parameters of a relationship?

    micinfo

      Greetings fellow File Makers:

       

      From my perspective, the graphic ER window in the fp7/fp12 platforms is a bit cumbersome if there are more than a handful of relationships in the file. I miss the basic alphabetical list of relationships we could access in FMP 6 and earlier. I've used the RelationInfo() function to retrieve the parameters of all relationships involving a sepcific data table, and I was wondering if there is a way to define (or edit) relationships via scripts rather than manually changing the parameters in the "Edit Relationship" dialog box. If there was a way to do that, then I could script a more user-friendly way to find/edit certain relationships, or for that matter, check to see if a relationship I want already existed! (Some of my files contain dozens of relationships).

       

      Thank you for your consideration.

       

      Phil.

        • 1. Re: Possible to script the parameters of a relationship?
          wimdecorte

          Not in the sense that relationships you define on the fly will show up on the graph.   But for defining relationships on the fly and showing the data in portals or working with that related data, see the technique called "virtual lists", in combination with the ExecuteSQL function

          • 2. Re: Possible to script the parameters of a relationship?
            beverly

            And Filtered Portals & Sorted Portals. These can use scripts and/or data entry to change the displayed values in a portal. - what Wim said with some other 'search terms' that will yield lots of results, too.

             

            -- sent from my iPhone4 --

            Beverly Voth

            --

            • 3. Re: Possible to script the parameters of a relationship?
              gdurniak

              That would be a very interesting feature request

               

              And yes, I also miss the FM 6 list of Relationships. The current graph is just stupid. Manage Database / Relationships has to have a list view, showing every "line" on the graph

               

              greg

               

               

              > I was wondering if there is a way to define (or edit) relationships via scripts rather than manually changing the parameters in the "Edit Relationship" dialog box.

              • 4. Re: Possible to script the parameters of a relationship?
                beverly

                +1 on the request to have another "hook" into the relationships other than the graph.

                 

                FYI, I wrote an XSLT that spits out the relationships (from DDR - XML) into an FM table. It's pretty handy just for "view" sake" - as it gives me what was in the old list of relationships. No can't edit (and make the change reflected on the graph).

                 

                Beverly

                • 5. Re: Possible to script the parameters of a relationship?
                  wimdecorte

                   

                  FYI, I wrote an XSLT that spits out the relationships (from DDR - XML) into an FM table. It's pretty handy just for "view" sake" - as it gives me what was in the old list of relationships. No can't edit (and make the change reflected on the graph).

                   

                   

                   

                  My short-lived GrokIt-tools did the same thing... Hmmm something like FMrobot Next would be able to port the changes to the graph...

                  • 6. Re: Possible to script the parameters of a relationship?
                    beverly

                     

                    If only... LOL

                    thanks, Wim!

                     

                    -- sent from my iPhone4 --

                    Beverly Voth

                    --

                    • 7. Re: Possible to script the parameters of a relationship?
                      micinfo

                      greg:

                       

                      It would be a VERY convenient set of calls, for sure. Such calls shouldn't impose any conflict with the manual process for defining a relationship in the graphic ERD window. In the very least, the call that creates the file reference for the relationship could simply create a graphic instance of that file in the ERD with the exact same default location and size as if you had created it via the manual process. LIkewise, a call that establishes the match fields would simply create an instance of the connection box between the file references in the ERD. It could be seamless with the manual process and would give us SO much more flexibility in establishing much more efficient ways to manage our relationships because having access to both the "set" and "get" functions would allow us to sort, edit, and display relationships whatever way is most relevant to each specific application.

                       

                      By the way, where does one go to report bugs and request new features at FMI?

                       

                      Phil.

                      • 8. Re: Possible to script the parameters of a relationship?
                        micinfo

                        Beverly,

                         

                        Yes I LOVE that technique of having checkboxes and pull-downs, etc. that allow us to modify what shows up in portals (e.g., "filters"). Such a feature really does stir the "Ooo"s and "Ahh"s from client users because  it speaks to the real power a database is capable of by giving them this interactive control over managing their data.

                         

                        And being able to script the relationship parameters opens enormous possibilities for developers to further expand the flexibility of database functionality way beyond what simple portal filters can offer.

                        • 9. Re: Possible to script the parameters of a relationship?
                          fmp

                          You could do something ginchy with GetField. The left side key would be GetField (field_name_entry_field_g). The right side could do the same thing if you could also update all the records in the match table via script. If not, you could concatenate whatever appropriate indexable fields in the match table into a multiline key field. But that might not work, for example in the area of false matches due to similar strings found in different fields. Like I said, "ginchy." Or you could use a "portal" table, whereby the script repopulates the table with records the script finds from the match table. Obviously, these are just workarounds; built-in functions would be better.

                           

                          I also vote for a list view of relationships (wide enough to see the whole name), with a click on a line taking you to the graphic view with the relationship hilited and in view.

                          • 10. Re: Possible to script the parameters of a relationship?
                            gdurniak

                            Feature Reqest is here:

                            http://www.filemaker.com/company/contact/feature_request.html

                             

                            If the fields all line up, and you flip the file reference, a single list layout could serve many tables

                             

                            You could then e.g. run two separate companies in the same office from the same screens ( which is asked of me quite often )

                             

                            Very powerful

                             

                            greg

                             

                             

                            > the call that creates the file reference for the relationship could simply create a graphic instance of that file in the ERD