6 Replies Latest reply on Mar 2, 2015 3:31 AM by MichaelWile

    How to store Portal Name in field

    MikeWile

      Title

      How to store Portal Name in field

      Post

      I have 2 portals named Portal1 and Portal2. I have a "Notes" table and notes can be entered into either portal. I would like to filter the notes so only notes entered from Portal1 show in Portal1 and notes entered from Portal2 only show in Portal2. I have a text field in my Notes table named PortalName. I would like to perform a calc that puts the PortalName into that field. Then I could filter by that name. I tried Get(objectName) as the calc but that didn't work.

        • 1. Re: How to store Portal Name in field
          philmodjunk

          You can set up the OnObjectEnter Trigger on each portal to perform a script to set a global variable to this value. You can use the same script on both portals but pass the object name of the portal as a script parameter.

          Then you can set up the object name field in the portal's table to auto-enter the value of this field and each new record will automatically enter the object name at the time it is created via interaction with the portal. This can be set up even more simply if you use a button and a script to create new records as the same script that creates a new portal record can also enter the object name.

          • 2. Re: How to store Portal Name in field
            MikeWile

            Thanks for your reply. I wanted to know how you pass the portal name (even to the script)? I had assumed it would be some sort of Get, but nothing I've tried seemed to work.

            • 3. Re: How to store Portal Name in field
              philmodjunk

              There is no such get function nor any other kind of function that returns the object name. You would type the literal object name into the optional script parameter box.

              Another option would be to define two relationships using two different sets of match fields for each portal. Two Calculation fields can be defined to return these same text constants (just text in quotes), and used as match fields in the relationships.

              And let us not forget that you could use different tables all together for the two portals. I have assumed that you have a reason for not doing that.

              • 4. Re: How to store Portal Name in field
                MikeWile

                Thanks for your help. I was hoping there was a way to reference the portal name.

                I will just use your suggestion to use a script on each of the two portals and pass the name that way.

                • 5. Re: How to store Portal Name in field
                  schamblee

                  Another solution you might consider is having two note tables.  You would have Portal1_Note_table and Partal2_Note_table.  This method would be easier to setup.

                  • 6. Re: How to store Portal Name in field
                    MichaelWile

                    Thanks for everyone's answers. Unfortunately, for other reasons I have to keep it to one table. I just went with using a script to enter the name of the portal.