3 Replies Latest reply on Jan 13, 2010 3:37 PM by philmodjunk

    two portals in one single layout

    franzele

      Title

      two portals in one single layout

      Post

      Hi all (my first post...).

       

      Using FM10 demo on a Mac OSX Snow Lepoard, and coming from a good PHP/MySQL experience. Almost new to the FM environment.

       

      I'm planning a one-user rather simple solution that should base on two tables, Products and Companies, 1-N related. Products lists a series of items, and Companies lists data for firms that can be producing and/or distributing the Products.

       

      I'm using this structure

       

      Products

      Code

      ProducerCode

      DistributorCode

      <other data>

       

      Companies

      Code

      <other data>

       

      I use two table occurrencies for Companies that are related with Products this way

       

      Companies prod::Code = Products::ProducerCode

      and 

      Companies distr::Code = Products::DistributorCode

       

      Until now, no problem in showing in Companies a portal with the products the company produces. But now I need a second portal in the same company record showing products the firm distributes, something like this

       

      Company

      <other data>

      produced                        distributed

      pr10 - hammer                pr21 - screwdriver

      pr15 - nails                     ......

       

      I thought that should have been easy in FM (not a problem in MySQL). But (surely for my minimal experience in FM) it's a lot I'm searching for a solution, but no way.

       

      Would some of you gurus be so kind to give me a hint to this situation?

       

      Thanks a lot

        • 1. Re: two portals in one single layout
          philmodjunk
            

          I'm guessing a bit here about how you've set up your layout, but it seems that you've based your layout  on the Companies prod table occurrence which makes your portal of products work as there is a link between Companies prod and Products. But with that arrangement, you don't have a table occurrence that links Products to your Companies prod table occurrence by Distributer code and this keeps you from setting up the second portal.

           

          You'll need another table occurrence or you could set up your TO's this way:

           

          Companies::Code = ProductsByProd:: ProducerCode

           

          Companies::Code = ProductsByDist:: DistributorCode

           

          Now base your layout on Companies.

          • 2. Re: two portals in one single layout
            franzele
              

            Thanks a lot for the quick and perfect answer. It seems I'm still a bit confused by this TO proliferation. But of course this means I need to get more experience with the FM development system.

             

            So I added another TO for Products and based my layout on the Company table (even graphically clear: the Company table between the two Product tables originating the two portals shown). And, since I needed also the Distributer and Producer names in the Product layout, ended up with two "real" tables and four TOs in the relationship graphic. But everything seems working now, so I suppose I have to get acquainted to this (for me) strange attitude.

             

            Anyway, thanks again 

            • 3. Re: two portals in one single layout
              philmodjunk
                

              If you take the time to compose some "Psuedo SQL" and compare the expressions to the Relationship graph, you should find quite a few similarities. It's just that it's now presented in a very different format. I have worked previously with the MS Access Relationships tool and this made the Graph familiar territory for me as it's fairly similar.

               

              You might find the following link helpful:

              Table vs. Table Occurrence (Tutorial)