3 Replies Latest reply on Mar 17, 2015 6:33 AM by Gilo

    Spider Web

    Gilo

      Title

      Spider Web

      Post

      Hi

      I have a hudge chaotic relations web, which seems to cause me some problems. Here is my setup

      client ----< household (based on clients)

      where client:adress = household:adress

      client ----< household ---< contracts

      where household:client_ID = contract:contract_client_ID

      So FM shows me on my client layout all contracts from the household, the client's from. Works perfectly. 

      But I need now a field client:check, which gives me back

      1, if there is one or more "Premium" in contract:contract_type
      2, if there is one or more "Gold" in contract:contract_type
      3, if there is one or more "Normal" in contract:contract_type

      I have a layout, based on clients, with a portal based on contract and it shows me all contracts of the client. But my field only checks the first line of the portal. If the 3 or 4 portal line has "Gold" it ignores it. Why is this? How can I solve this problem?
       

        • 1. Re: Spider Web
          philmodjunk

          Seems like you need theses relationships: Contracts>----Client-----<Household. Client::Client_ID = Contract::Client_ID

          Any calculation that refers to a field from a related table where there are more than one related records will only refer to the "first" related record except for aggregate type functions that compute a value from all related records.

          But don't use any field for what you want here. use three one row, filtered portals to contracts. Define a "count of" summary field in Contracts that counts a never empty field such as contract_Client_ID and put that in the portal row in each case. Add a portal filter that filters for a specific contract type in each portal such as Contract::ContractType = "Premium".

          Each portal will then show a count of how many contract records exist for a given client of each type.

          In order to get better control of your "spider web", I suggest investigating a method for organizing your relationships graph known as "anchor buoy". Then if you want to take anchor buoy to a new height, web search "Selector connector" a new take on anchor buoy that originates with Todd Geist and SeedCode.

          • 2. Re: Spider Web
            Gilo

            thanx.

            But I don't want portals on my layout. I need the field to have a number from 0-3 in order to show an image (ok) by using a relation.

            Sorry it's quite complicated. I want a layout based on client, where i have a pictogram of several products. If they have a certain product, there should be an "ok" next to the product picto. one product would be "premium" and if the client has that product, it should show the client "ok". So the client sees quickly if he has a product or if it is missing. 

            So your suggested solution with the portals seems not to work for me.

             

            • 3. Re: Spider Web
              Gilo

              Hello again 

              I got this to work:

              Falls(NICHT IstLeer ( FilterElemente ( Liste ( tous contrats ménage::contrats_type ) ; "Premium Perfect Plus" ) ) = 1; "1";
              NICHT IstLeer ( FilterElemente ( Liste ( tous contrats ménage::contrats_type ) ; "Premium Perfect" ) ) = 1; "1";
              NICHT IstLeer ( FilterElemente ( Liste ( tous contrats ménage::contrats_type ) ; "Premium Select" ) ) = 1; "1";
              NICHT IstLeer ( FilterElemente ( Liste ( tous contrats ménage::contrats_type ) ; "Premium Classic" ) ) = 1; "1"; 
              0)

              Case (NOT isEmpty (Filter (list (Liste ( tous contrats ménage::contrats_type ) ; "Premium Perfect Plus" ) ) = 1; "1";

              and so on... 

              thank you