7 Replies Latest reply on Feb 28, 2015 3:11 PM by mdphillips

    Records not visible in portals

    mdphillips

      Title

      Records not visible in portals

      Post

      I've been working on a solution to track training for a group.  After some great help from ModPhil I'm making progress.  The problem I'm having now is that I can't records to show up in some portals. Using the relationship graph for reference - I have layouts for Team Members, Member Positions & Evaluations.  In Team Member layout the portal works as expected and shows the related records from Member Positions.  In the Member Position layout I have a portal that I need to records from Evaluations in.  The portal is based on "Evaluations" and I added the fields from the evaluations table I wanted to show but they don't populate.  It's probably something simple I'm missing but can't for the life of me figure it out.  Any ideas would be greatly appreciated!

      Here's a reference to the original post - http://forums.filemaker.com/posts/a37cbcd05f

      Tables.JPG

        • 1. Re: Records not visible in portals
          ChrisJohnston

          See if this helps. If you need a different version of FileMaker < 12 let me know.

          change the 000wrongNumber to the correct number matching Member Position numbers to see it update

          Download

           

          • 2. Re: Records not visible in portals
            philmodjunk

            Your setup sound correct. I wouldn't expect you to need a portal filter, so the possibility that you have a portal filter that is excluding the records is unlikely.

            Best guess is that the values in the Evaluation::id_memberposition fields do not match to the value of Member Position::id_memberposition and thus do not appear in the portal.

            You may want to copy the value of id_memberposiiton from your current Member Position record to the clipboard, switch over to a layout based on Evaluation (a table view can be very helpful here), enter find mode and paste the value into the id_memberPosition field and perform the find to see if any records are found. When you do this, enter ==", now paste and add a " after the pasted text. This will search for exact matches and not just entires that start with the same characters or that might look the same but have leading or trailing spaces (or other invisible characters). This last issue is something that can keep records from matching if your id fields are of type text instead of number.

            • 3. Re: Records not visible in portals
              mdphillips

              Phil you are a Godsend.  I didn't even get to the cut & paste part of your suggestion when I saw a problem.  I went to the table view for evaluations saw that the id_member position field for the records was not populated.  I manually typed in a few and that did the trick.  I can now see the evaluations in the portal (at least for the records I fixed) the question is where did I go wrong in the first place. I suspect it may be my newbie scripting skills.  I made a button "Add Evaluation" and used the script below. Does anything look funky in that?

              • 4. Re: Records not visible in portals
                philmodjunk

                Um yeah and it's one that's created a few forehead shaped dents in my monitors over the years. The variable in your set field to assign an ID to the new record is named differently than the one in set variable step that is supposed to be capturing that value. There's an underscore in the one that is not in the other so your set field is referring to a non-existent variable and thus assigns no value to the new record's match field.

                But you do know that if you enable "allow creation" for the evaluations table occurrence, you can simply type data into the bottom "add" row of the portal and create a new record with matching ID's entered for you? I realize that there are advantages to the scripted approach if you have a lot of stuff in the portal and don't want to keep scrolling the portal to get to the add row, but it does avoid the need for any script at all for creating new evaluation records.

                (And I would not have name fields in the evaluation table nor a position field. That creates a second, redundant copy of data better kept in the original table. Given your relationships, it's usually quite simple to just include the field from the appropriate related table instead of copying this data from table to table like this.)

                • 5. Re: Records not visible in portals
                  mdphillips

                  Dang it's hard to proof your own writing - good eyes Phil! 

                  I do know about the "allow creation" option and had used it in the creation of member position records but could not get it to work correctly for the evaluations.  That was probably another newbie mistake in the setup but I think I have that figured out.

                  LOL on the name fields, etc.  I actually do get the data from the related data from the appropriate related table.  I think that I originally thought I had to have matching fields in those tables and just forgot to delete the fields - my newbie-ness is blinding!

                  So at this point is my best bet to fix the error, delete the evaluation records and re-enter that data?

                  • 6. Re: Records not visible in portals
                    philmodjunk

                    I've been doing this for quite a few years (Since FMP 2.5) so when you indicated that the field was blank, I had a pretty short list in mind of ways that might happen before I even looked at your script. laugh

                    For what it's worth, I've taken to copying the variable name to the clipboard from whatever script step or calculation creates the variable to paste into subsequent expressions that reference that precisely because there are no warnings that pop up to tell you that you mistyped the name of the variable.

                    As to your question: probably. You might be able to manually enter the needed values, if there aren't too many to fix and if you can tell by inspection which evaluations link to which join table records.

                    • 7. Re: Records not visible in portals
                      mdphillips

                      The clipboard thing is a great tip - I'll be using it from now on!

                      FM is awesome and pretty easy to use but sometimes just knowing what it's capable of can be overwhelming.  Since I'm learning the art of DB programming as I go I think choosing FM as my management system was the definitely the right choice.

                      As always, I really appreciate your patience, guidance, and willingness to help us new kids!

                      My next step in the project is try to add some reports and maybe some graphs or calculation fields so I might have to tap your well of knowledge again soon. smiley