1 Reply Latest reply on Oct 5, 2015 9:43 AM by erolst

    how to display all available + reserved flats on client screen


      I have 2 lists: people (potential clients of real estate agency) and list of flats.

      I try to find best way how to display all available flats on client detail screen (in portal) I could set reservation for flat (or set flat is sold to this client). I can’t find best way how to see all available flats + flats reserved/purchased by client.

      Is it possible to display both views (available flats and flat reserved for client) in one portal? How can I manage flat status (available > reserved > sold) – should I create 3 buttons/scripts to switch flat status or I can use easy field with drop-down list of 3 values?

        • 1. Re: how to display all available + reserved flats on client screen

          If you want to show all flats, then use a Cartesian relationship (match any two fields on the x operator).


          Now you could display a portal into that relationship, and use a toggle (field/variable) to drive a filter calculation that switches between displaying all records, or only those that are related to the current client; along the lines of


          IsEmpty ( $$filter )


          not IsEmpty ( FilterValues ( Flats__Cartesian::id ; List ( Flats::id ) ) )


          assuming that you have a relationship

          Client::id = Flat::id_customer


          On the other hand, this could get real slow when the list of flats grows; so another idea would be to simply have two portals – one into the Cartesian relationships, another one into the relationship by Client – and use a script to toggle their display using “Hide if” and toggling a $$variable.


          btw, you should probably have three tables: Flats, Clients and a join table FlatClients; otherwise you'll run into problems if the same flat will be related to multiple clients over its lifetime (or its lifetime in your agency).