1 2 Previous Next 17 Replies Latest reply on Aug 19, 2011 11:35 AM by EmmettOliver

    Working Between Layouts on the Same Record

    EmmettOliver

      Title

      Working Between Layouts on the Same Record

      Post

      Hi all,

      I have two layouts "Report" and "Family" where "Report" is the parent table's layout and "Family" is the related table's layout.  The problem I have is navigation back and forth between the two on the same record, which is tied to __kp_ReportID = _kf_ReportID.  I have buttons on each layout to toggle back and forth between the two.  I have the "Family" button on the "Report" layout going to the correct record using a GTRR script, but I cannot get the "Report" button the "Family" layout to work.  I've tried GTRR and the following too:

      Set Variable [$Criteria;Value:Family::_kf_ReportID]

      Go To Layout ["Report" (Report)]

      Enter Find Mode []

      Set Field [Report::__kp_ReportID; $Criteria]

      Perform Find []

      I kind of need that to work because in some instances we may be searching the db with only a name on the "Family" layout, which after a find, we'll need to go to the "Report" layout for that record to get the information needed.  I hope that makes sense.  Thanks, Emmett

        • 1. Re: Working Between Layouts on the Same Record
          philmodjunk

          To me, your relationship seems backword. What you describe implies that for any one report record, you have multiple family records related to it. Don't you have the opposite--one family with many report records?

          If so, you should have this relationship:

          Family::__pk_FamilyID = Reports::_fk_FamilyID

          and in some cases, you may actually have a many to many relationship if a report can list many family records and a given family should be linked to many reports. If that's the case let me know and we'll take look at how to use a join table to make that work for you.

          • 2. Re: Working Between Layouts on the Same Record
            EmmettOliver

            Hi Phil,

            Thanks for the quick response.  Actually, it's one report to the many family members.  We actually tie everything to the mother because one can only have "one" biological mother and generally speaking even if she shows up in another report she'll be a step-mother or other collateral. So, it kind of tracks as one per family based on bio-mom.  If there is no bio mom, we'll go with unknown in that field, but there will be only one report for those biologically related children whether mom is deceased or unlocated.  As it turns out, the searching we do with only a name is usually the mother's first and last name. 

            Emmett

            • 3. Re: Working Between Layouts on the Same Record
              EmmettOliver

               You know.  In some cases there will be a many to many relationship.  So, I will need to explore the join table.  Would the "Family" actually need to be the join between the report and the mother or children?

              • 4. Re: Working Between Layouts on the Same Record
                philmodjunk

                Then both Go To Related Records and the scripted find approach (Use both all the time) should work for you. There must be some detail not quite right.

                I assume that you have this in Manage | Database | Relationships?

                Reports::__kp_ReportID = Family::_kf_ReportID

                If you place a portal to Family on the Reports layout, do you see the expected list of Family records?

                If yo uplace the Mother's name fields from Reports on the Family layout, do you see the correct name?

                are both ID fields of type number?

                • 5. Re: Working Between Layouts on the Same Record
                  EmmettOliver

                  I assume that you have this in Manage | Database | Relationships?

                  Reports::__kp_ReportID = Family::_kf_ReportID

                  This I have

                  If you place a portal to Family on the Reports layout, do you see the expected list of Family records?

                  This works

                  If yo uplace the Mother's name fields from Reports on the Family layout, do you see the correct name?

                  This does not work

                  are both ID fields of type number?

                  Both are of type number

                   

                   

                  • 6. Re: Working Between Layouts on the Same Record
                    EmmettOliver

                     This one is confusing.  Wouldn't having fields for the family in both tables "Report" and "Family" be a duplication of data?  However, I do have a case number field in both the "Report" and "Family" tables that is unique to the mother that we get from another database, but when I use that case number in the scripted find it still doesn't work.  Thanks again, Emmett

                    • 7. Re: Working Between Layouts on the Same Record
                      philmodjunk

                      Wouldn't having fields for the family in both tables "Report" and "Family" be a duplication of data?

                      Not if the Family fields on each layout come from the family table. Keep in mind that while their names may be the same, layouts and tables are not the same thing.

                      If a portal To family on the reports layout displayes the correct family records, then the following steps should work for you:

                      Go to the family layout and enter layout mode.

                      Use the field tool to add a field to the layout.

                      Select Reports in the drop down in the specify fields dialog and click the Mother's name field in the list to select it. This adds the mother's name field from the Reports table to your Families layout.

                      Enter browse mode and confirm whether or not you see the correct Mother's name in this newly added field.

                      Further questions:

                      Are Families and Reports both defined as tables in the same file or different files?

                      • 8. Re: Working Between Layouts on the Same Record
                        philmodjunk

                        We must have posted simultaneously a while back. I just spotted the post you made about this sometimes being a many to many relationship.

                        To establish a many to many relationship between Familes and Reports, you'd set up this relationship:

                        Families::FamilyID = Family_Report::FamilyID
                        Reports::ReportID = Family_Report::ReportID

                        Families::FamilyID and Reports::ReportID should be auto-entered serial number fields. Family_Report is a "join" table that makes a many to many relationship possible. A portal to Family_Report can be used on a Families layout to list all assigned Report records. A portal to Family_Report placed on a Reports layout will list a Family records asociated with that report.

                        • 9. Re: Working Between Layouts on the Same Record
                          EmmettOliver

                          Thanks Phil.  I think we did simul-post.  I'm going to create the join table.  "Family" and "Report" are defined as tables within the same file.  I'll have to get the layouts back in order from making the change, put some data in that's safe and then i'll post a link to the file so you can see it.  I hope it works!  The fun begins.  Thanks again, Emmett

                          • 10. Re: Working Between Layouts on the Same Record
                            philmodjunk

                            Here's a demo file that matches "contracts" to "companies" in a many to many relationship that you can download and disect for implementation details:  http://www.4shared.com/file/PLhjErzu/Contracts_to_Companies.html

                            • 11. Re: Working Between Layouts on the Same Record
                              EmmettOliver

                              Hey Phil, will you repost that link?  I keep getting an error message.  Thanks, Emmett

                              • 12. Re: Working Between Layouts on the Same Record
                                philmodjunk

                                What error message do you get? When I click the link. I get the expected download page... If I click the download now button, I get the download page where I wait 20 seconds for a download link. When I click that link, I am able to download the file.

                                • 13. Re: Working Between Layouts on the Same Record
                                  EmmettOliver

                                  Nevermind, it's our firewall. 

                                  • 14. Re: Working Between Layouts on the Same Record
                                    philmodjunk

                                    Virus protection can also be a factor. It seems that 4Shared is not always careful about what it permits its advertisers to put on the download pages--at least that's my conclusion from error messages that pop up on my screen from time to time. I've reported this at least twice to 4shared...

                                    1 2 Previous Next