12 Replies Latest reply on Sep 14, 2011 10:01 AM by philmodjunk

    Portal Setup Command

    lbellino

      Title

      Portal Setup Command

      Post

      I'm trying to find in my FMP training manual about the how this works and what the "Sort Portal Records" does, but can't find it. I know when I go to the next step in adding fields, this adds the fields of the table I select, but was curious what the first part does when I click on the "Sort Portal Records", especially, if I pick a different table in this case, and a different table for the fields in the same portal. Hope that make sense of what I'm trying to ask.

       

       

       

      Portals.PNG

        • 1. Re: Portal Setup Command
          philmodjunk

          Sort Portal records is how you specify in what order the related records will be displayed. If you have a date field in your portal table, for example, you can use sort portal records to list the related records in descending order by date which results in the related record with the most recent date being listed in the first row of the portal.

          • 2. Re: Portal Setup Command
            lbellino

            So the portal records I'm sorting is from the table that I select, correct? If that's that case, then when I go to the next pop up where it's asking me for fields that I want to display in this portal, I see I can pick from any table that is listed in my database. Is it better to use the same table for these fields? Also, if I decide to pick from a different table, I'm assuming that the field has to have some relation to the records, correct? I just want to know the point in being able to select from the different tables when I get to the second pop up.

            Also, I've replaced the original image to show what I'm trying to do a couple of things and I don't know how or if it's possible. For the two portals showing the Additional Office Sq Ft and the Office SQ Ft, is there a way to combine all this information into one portal or do I have to keep separate like I have it? The goal I'm trying to acheive is to have a portal that will total all office sq ft. I was able to create a field to total up the Sq Ft. number, but can't figure out how to have them all list in one portal.

            For the Total Stock Sq Ft portal, is there a way to keep the areas listed but only show the one stock total in the portal, instead of keeping it outside the portal? As you can see, I have the total listed 3 times due to the one field showing for each record, but want to only show the total once. Thanks for the help.

            • 3. Re: Portal Setup Command
              philmodjunk

              When you are first starting out, it's safest to only specify fields from the same table occurrence that you selected in Show Records From in Portal Setup... (Table occurrences are the boxes in manage | Database | Relationships.) You can select from other related table occurrences at at times this can be very useful, but care must be taken to understand how the relationship between the two occurrences work so that you can determine if the field from a related table occurrence will or will not display the correct data.

              I can't see your new image upload. This is an ongoing issue with the forum. You'll see the new image, but I won't. Re-edit the post, delete the image. Save it to the forum, then edit it yet again and upload your new screen shot...

              Whether you can combine the fields in one portal depends on the structure of those relationships between table occurrences that I just mentioned in the first paragraph.

              Portal totals typically need to be placed outside the portal if you do not want it to be displayed in every portal row. A portal total can be computed with either a calculation field using an aggregate function such as Sum or Count. You can also define a summary field in the portal's table place this summary field outside your portal.

              • 4. Re: Portal Setup Command
                lbellino

                Image has been reposted. Let me know if you can see the updated image. Thanks.

                • 5. Re: Portal Setup Command
                  philmodjunk

                  I can see it.

                  It still comes down to the relationships between the data in the two portals. What connection, if any is there between "additional office square footage" and "total office square footage"?

                  • 6. Re: Portal Setup Command
                    lbellino

                    The relationship between the two groups is that they're all offices within a store. I had to separate them out by categories, because not all stores have "additional offices", but stores that do, I need to be able to provide a total of all offices. I was hoping to be able to create a count of both the "offices" and "additional offices" categories, but didn't know the proper calculation. I'll see if I can upload a different image of the tables that I'm referring to. Thanks.

                    • 7. Re: Portal Setup Command
                      philmodjunk

                      The two portals can draw data from the same table and yet display the two different sets of records that you show if you set them up with portal filters. Add a number field called "additional" to your portal's table. Format it as a check box with 1 as it's only value. Resize the field to hide the 1.

                      For every record that you want to display in the left hand portal, click this check box.

                      Define this portal filter for the left hand portal:

                      YourTablenameHere::Additional

                      Use this portal filter for the right hand portal:

                      Not YourTablenameHere::additional

                      Now you have all your records in one table which will make it easier to compute your totals, but the filters allow you to display them in two groups like you have them on your layout.

                      • 8. Re: Portal Setup Command
                        lbellino

                        Well, I'm trying to only do one portal containing all this information from the "offices" and "additional offices" categories and not two. Is that possible or do I have to keep two separate portals for each category and just create one field that would add the totals of these two categories? I was trying to figure out with the image that is currently posted, how I can get the "_ka_constant_offices_all_ct" field calculation to work, since what I have currently does not. Is that even possible? Thanks.

                        • 9. Re: Portal Setup Command
                          lbellino

                          Or was your last comment in relation to what I was trying to do with showing only 1 total for the total sq stock number, when I have more than one stock area showing? Wasn't sure. Thanks.

                          • 10. Re: Portal Setup Command
                            philmodjunk

                            If all the records are in one table to begin with, then you can use a single portal to display all of them. I just see possible advantages to using two filtered portals to better display them.

                            When I look at your calculation, all it does is produce this text: officesadditional offices

                            What result are you trying to produce?

                            • 11. Re: Portal Setup Command
                              lbellino

                              I was trying to list the records in one portal that had either of these type of category associated with it for a particular store that's it's related to, if it was a possiblity.

                              Also, will you be able to help me on the issue I'm having with the "Total Stock Sq ft", that I noted in an earlier comment? That would be great! I updated the image to show the total stock portal that I'm tyring to fix to just show one total for all items listed.

                              • 12. Re: Portal Setup Command
                                philmodjunk

                                I was trying to list the records in one portal that had either of these type of category associated with it for a particular store that's it's related to, if it was a possiblity.

                                Does that mean that you have other categories possible besides "Offices" and "Additional Offices"?

                                You can set up a portal filter expression in portal set up to filter for specific categories.

                                YourPortalTable::category = "offices" Or yourPortalTable::category = "Additional Offices"

                                Would limit your portal to related records where only one of these two values is stored in the category field. (Use your table and field names in place of mine here.)

                                To compute a portal total, there are two options and whether or not you'll use a portal filter is a key detail in determining which method to use:

                                Assuming that the portal is filtered, define a summary field in the portal's table that computes the total of the field in your portal's table that you want totaled. Place the summary field from this table on your layout, but place it inside its own one row portal with the same portal filter as the original portal. You can make the portal borders invisible to make it look like any other field on your layout.

                                If you do not use a portal filter, you can place this field directly on your layout and not put it inside a portal.

                                If you do not use a portal filter, you can also define a calculation field in the layout's table that uses the Sum function to compute the total. This can be a better option if you intend to use this layout for data entry where the changes made by the user may change the values being added up into a total.