4 Replies Latest reply on Dec 7, 2012 11:35 AM by Dekade

    Need a single field to show portal selected items

    Dekade

      Title

      Need a single field to show portal selected items

      Post

           In a database and on any given record I have a portal.

           Each portal row represents a topic that can be selected that will be associated with the record.

           There are about 75 topics (rows) in the portal.

           I am able to select one or more of the portal rows (topics) using the Cartesian join operator "X".

           I would like to have a field off to the side on each record. This field will show all of the chosen "X" fields from the portal (but, obviously not the unchosen fields). I would like the field to be vertical with one line representing each "X" topic.

           As you move from record to record that field will show different choices because each record will have different topics associated to it.

           Additionally - as one topic is "unselected" in the record portal that topic then automatically disappears from the field list for that record.

           How do I go about accomplishing this field creation?

           Thanks,

           Dekade

        • 1. Re: Need a single field to show portal selected items
          philmodjunk

               Why would you want data from multiple fields in multiple records to appear all in one field? (I could be wrong, but that's how I understand your post.)

               Wouldn't it make more sense to have a second portal where records from the first portal appear if they are selected with a mouse click or other user action on the first portal?

          • 2. Re: Need a single field to show portal selected items
            Dekade

                 PhilModJunk,

            "Why would you want data from multiple fields in multiple records to appear all in one field? (I could be wrong, but that's how I understand your post.)"

                 I do not need multiple fields from multiple records to appear in one field.

            "Wouldn't it make more sense to have a second portal where records from the first portal appear if they are selected with a mouse click or other user action on the first portal?"

                 This certainly sounds like what I want to accomplish. I simply had not envisioned it as being a second portal setup. Can you get me going on how to do that second portal?

                 Dekade

            • 3. Re: Need a single field to show portal selected items
              philmodjunk

                   Let's say your layout refers to a table occurrence named "Layout" and your portal refers to a table occurrence named "portal". Let's assume that the portal table has a primary key field named __pkPortalID.

                   Then create a new occurrence of Portal, named SelectedPortal.

                   Add a text field to Layout named SelectionList.

                   Add a new relationship for your second portal like this:

                   Layout::SelectionList = SelectedPortal::__pkPortalID

                   Then a script peformed from a button clicked in the first portal (the one based on the X operator), that does this:

                   Set Field [Layout::SelectionList ; List ( Layout::SelectionList ; Portal::__pkPortalID ) ]

                   will add that portal record to any already displayed in the second portal.

                   You can give that button a script that mimics check box behavior. Click it once to add the record, click it a second time to remove it from the second portal:

                   If [ IsEmpty ( FilterValues ( Layout::SelectionList ; Portal::__pkPortalID ) ) // Record is not yet selected ]
                      #Select the Record
                      Set Field [Layout::SelectionList ; List ( Layout::SelectionList ; Portal::__pkPortalID ) ]
                   Else
                      #De-Select the Record
                      Set Variable [$Temp ; value: Substitute ( ¶ & Layout::SelectionList & ¶ ; ¶ & Portal::__pkPortalID & ¶ ; ¶ ) ]
                      Set Field [Layout::SelectionList ; Middle ( $Temp ; 2 ; Length ( $Temp ) - 2 ) ]
                   End If

                   Note: with conditional formatting using the expression inside this If step, you can make layout text such as an "X" or a "tick mark" appear and disappear when the above script is performed.

              • 4. Re: Need a single field to show portal selected items
                Dekade

                     Thanks PhilModJunk. I'll spend time with it to see where I can take it.

                     Dekade