3 Replies Latest reply on Jan 25, 2011 3:06 PM by philmodjunk

    Is it possible to place two portals on the same layout?

    johnsmith_1

      Title

      Is it possible to place two portals on the same layout?

      Post

      Hello,

      I know that this question has been asked before but I couldn't get right the trick behind the solution.

      Maybe some indulgent fmpro advanced user could patiently share some knowho with me.

      Is it possible to get different data on two portals on the  same layout based on the relationship established between two tables  through a joint table?

      If the answer is yes I would appreciate guidance on how to do it.

      My table stettings are as follows

      Document table

      __pkFID

      other fields

      Person table

      __pkPersonID

      NameFulList

      NameFull

      NameLast

      NameMiddleInitial

      NameFirst

      PersonJobTitle

      PersonrDepartment

      other fields

      Appraisal (joint table)

      __pkAppraisalID

      _fkFID

      _fkPersonID

      NameLast

      NameMiddleInitial

      NameFirst

      The Appraisal joint table was created to sort out the many-to-many relationship between Document and Person tables.

      The relationships so far established between the TOs are as follows:

      Document to Appraisal (one to many): Document __pkFID::Appraisal_fkFID

      Person to Appraisal (One to many): Person__pkPersonID::Appraisal_fkPersonID

      My objective is to record both the reviewers and approvers on each document. To achieve this, in the Entry layout of Document table I have a tab named Appraisal where I have put two portals one for the reviewers and another for the approvers.

      Since the two portals should have different values, I wrongly assumed that the solution was to create another TO for the Person table and establish the adequate relationships, but it dindn't matter what I did becuase I was always getting the same values on both portals.

      What I tried and din't work was to create a new TO for the Person table. I named it Person 2 and established a relationship with the Appraisal joint table.

      My idea was for one portal to get the data from the Person -> Appraisal realtionship and for the other portal to get the data from the Person 2 -> Appraisal realtionship.

      But no matter how I set up the fields on both portals I was getting the same values on both.

      What do I have to do to achieve this?

      Thanks,

      fmnovice

        • 1. Re: Is it possible to place two portals on the same layout?
          philmodjunk

          The Name fields in appraisal appear redundant. From what you describe, I don't see a purpose for them. In what field do you identify who is a "reviewer" and who is an "approver"?

          I'll assume that this is recorded in a field in Person, though a field for this can also be defined in Appraisal if one person may be a reviewer for one document and an approver for another. Either way, the basic approaches below work, but you may need to modify to suit your actual situation here.

          In FileMaker 11, you can place two portals to Appraisal or to Person on your document layout. Define different portal filters for each such as:

          Person::JobTitle = "reviewer" for the reviewer portal and Person::JobTitle::"Approver" for the approver portal.

          If you don't have FileMaker 11, you'll need to do this on the relationship level with two TO's like you started out to do.

          Define a pair of calculation fields, cApproverKey and cReviewerKey in Appraisal so that they return the text: "Approver" and "Reviewer" respectively.

          Now define these relationships for your two portals:

          Approver_Person::__pkPersonID = Appraisal::Appraisal_fkPersonID AND
          Approver_Person::JobTitle = Appraisal::cApproverKey

          Reviewer_Person::__pkPersonID = Appraisal::Appraisal_fkPersonID AND
          Reviewer_Person::JobTitle = Appraisal::cReviewerKey

          Place a portal to Approver_Person and to Reviewer_Person (Both TO's of Person) on your documents layout.

          • 2. Re: Is it possible to place two portals on the same layout?
            johnsmith_1

            Hello PhilModJunk,

            Thank you for looking into my question and for your expert directions.

            I am almost there but not quite yet.

            Maybe I will save you time if I show you first how I set up the tables, relationships and the portal in the layout. I am sure you can easily find my mistake that will explain why I haven't beenable to make it work yet.

            So first, the table structures:

            Document Table Structure

            document table structure

            Person Table Structure

            person table structure

            Appraisal Table Structure (joint table)

            appraisal table structure

            Tables Relationship Graph

            tables relationship graph

            Document::Appraisal Relationship

            document appraisal relationship

            Person::Appraisal Relationship

            person_appraisal_relationship

            Now the portals in Document layout

            In the Appraisal tab of the Document layout I have inserted two portals:

            portals

            Since I have FM11Pro Advanced I chose your first option: portal filtering

            Reviewer Portal

            reviewer portal

            Reviewer Portal Filter

            reviewer portal filter

            Reviewer Portal Fields

            I have three fields in the Reviewer Portal:

            Appraisal::_fkPerson ID field. This field has attached  the Popup menu Person that uses values from field: "Person::__pkPersonID" and "Person::NameFullList"

            Person::PersonJobTitle field.

            Person::PersonDepartment field

            Approver Portal Filter

            approver_portal_filter

            Approver Portal Fields

            The fields in are the same as in the reviewer portal

            I have three fields in the Approver Portal:

            Appraisal::_fkPerson  ID field. This field has attached  the Popup menu Person that uses  values from field: "Person::__pkPersonID" and "Person::NameFullList"

            Person::PersonJobTitle field.

            Person::PersonDepartment field

            Once I have all this in place and mode into browse mode to enter values in the appraisal tab of the Document table all sort of strange things happen: values entered relocate themselves from one record to another, some records duplicate themselves, etc.

            So I hope that you will be able to find out what I did wrong.

            Thanks agains for your time and expertise,

            fmnovice

            • 3. Re: Is it possible to place two portals on the same layout?
              philmodjunk

              Once I have all this in place and mode into browse mode to enter values in the appraisal tab of the Document table all sort of strange things happen: values entered relocate themselves from one record to another, some records duplicate themselves, etc.

              You need to describe this in greater detail. Note that you can create appraisal records in either portal, but if you select some one whose PersonFunction field = "Approver" in the Reviewer portal, that record will disappear from the Reviewer portal as they will be excluded by the portal filter and then their record will appear in the "Approver" portal as that filter will include them.

              The portal filter only controls what records will be visible in a given portal, it does not cause data to be automatically entered.

              I'd add the Person::PersonFunction field to your portals temporarily, so that you can see better what is going on when you select a person in these portals.