1 2 Previous Next 24 Replies Latest reply on Oct 25, 2011 10:59 AM by JamesRoland

    How can I stop a portal jump to first record

    ricavery

      Title

      How can I stop a portal jump to first record

      Post

      I am using a 600 records database in FileMaker Go with a portal to select any record. The portal is in the body with the whole record in header. I am using a short script to make this selection, to activate the proper record and the proper row. It works well, but...

      The only problem I have is the portal always jumping to the first row or record on the iPad. On the Mac, the chosen record is placed at the bottom of the portal list. I could live with this on the iPad... I read about this problem on internet and tried varied tricks in the layout preferences and elsewhere... nothing seems to work...

      I only want FileMaker no to do whatever it does when I select a row in the portal... I tried canceling sorting at the end of my script, but it does not work.

        • 1. Re: How can I stop a portal jump to first record
          tcmeyers

          Richard, you might take the opposite approach; have your list of choosable records as a one-record-per-line list in the body section (the body part is vertically short, just enough to display what you have been showing in one line of your portal) and then make the touch-script for the list buttons place the record ID (whatever is unique) into a global field, and use that field as the selector in a relationship to the same table. Then, in your header part, display the detailed fields (editable or not) that you have been showing in the headers, but as RELATED fields instead.

          I just built a sample layout and tried this on the iPhone, it works fine. The line you touch does not move, and the related stuff in the header body part displays appropriately, and is editable, for the selected record below.

          -Troy

          • 2. Re: How can I stop a portal jump to first record
            ricavery

            Troy, I want to understand and adopt your solution...

            But I am not certain that I really know what you mean by a one-record-per-line list... I am using FrameMaker 10 in French and it is not always easy to make the correct connections between languages and words...

            If understand well what you say, I should not have to use any portal. What you refer to seems to be a list (not a table), that would show me access to all records in the body, with a complete editable selected record in the header. If it works indeed, it should be much simpler than my adventures with a portal...

            I will have to go back to FileMaker to get some better understanding about this...

            • 3. Re: How can I stop a portal jump to first record
              tcmeyers

              Richard,

              Yes, that is exactly what I mean. No portal, just a list of records in the body. To accomplish the list in layout mode, you just make a skinny body that holds a few details about one record, but when displayed, will be the the list. And yes, I did test this, and the selected record is editable in the header. For the header, to make the change, you would just change each field that you already have, to the same field, but through the relation. If you could tell me the actual table name, the name of a unique field (like an ID or serial number), and the name of an example field you have up top, I can give you an actual example way to set this up, with real relationship names.

              -Troy

              • 4. Re: How can I stop a portal jump to first record
                tcmeyers

                Richard,

                I just rethought this, and realized it isn't even necessary to run script to set a global. If the relationship is instead ID=ID, then the related record up top is shown as soon as the desired record below is touched. This is more straightforward, and slightly faster than scripting it.

                -Troy

                • 5. Re: How can I stop a portal jump to first record
                  ricavery

                  Hello Troy,

                  I did in fact create a new list layout and copied all the previous editable fields in the header... and rearranged the list fields to my taste in the body... and everything was working perfectly without any more variables or scripts. 

                  One question? I could not find any other way to get a list of fields in the body than by creating a new list layout. And then, I cannot change the body color background... Is there no way to just insert a list of fields in the body of any already existing layout?

                  Many thanks for your help in this matter...

                  • 6. Re: How can I stop a portal jump to first record
                    tcmeyers

                    Richard,

                    When you are in Layout mode, you can drag new field elements onto the layout from the tool bar. It's the icon that is 3rd from the right, starting with the paintbrush.  It looks like a little field with a cursor line in it, and a fat arrow hanging off of the bottom of it. Click and hold down on it, drag down into the layout, and release where you want to place the additional field. As soon as you let go, a box comes up allowing you to select what field name you want to add.

                    Except at the creation of a totally new layout, fields must be added one by one, so there is no way to add a list of them all at once.

                    You can also change fields already on the layout to different ones, by selecting the field, and with the Inspector floating window in "Data" mode (that's on the tab), click the pencil button next to the name of the existing field.

                    To change the background color of the body (or any part), in Layout mode, click on the "Body" part indicator (which may be either horizontal or vertical, but is a small rounded rectangle with "Body" on it) and then in the Inspector floating window, select "Appearance" mode (that's on the tab) and in the Object section, select the fill color and pattern.

                    -Troy

                    • 7. Re: How can I stop a portal jump to first record
                      ricavery

                      Troy,

                      Thanks again for your help...

                      I am now trying to highlight the selection in list view, without any editable possibility...

                      Richard

                      • 8. Re: How can I stop a portal jump to first record
                        tcmeyers

                        Richard,

                        This can be done, but it's a bit complex to describe, though simple in concept. I'll try the simple way first.

                        Have a global numeric field, call it Current Record ID.

                        Set a script trigger for the layout (in the Layout Setup box) of the kind: OnRecordLoad

                        Call the script "Flag Current Record" or something, and it should have one step:

                        SetField [TableName::Current Record ID; Get ( RecordID)]

                        (TableName should be the name of your table)

                        Choose an item in the body, such as the primary name listed, and set a Conditional Formatting, such as changing the text color to red or the background or something, using the 'Formula is' box with this in it:

                        TableName::Current Record ID = Get ( RecordID )

                        This will turn the text of the name red (or whatever) for the currently selected record.

                        Unfortunately there isn't a Conditional Formatting for all types of objects. You can't do it to the Body part, but you can do it to an empty static text element, so if you made one of those to cover the entire body, then you could change the background of it. You should put that object behind all the other objects in the Body.

                        I've just tested all this and it works here both on the desktop and the iPhone.

                        Hopefully you are familiar enough with these methods so that you can set it up!

                        -Troy

                        • 9. Re: How can I stop a portal jump to first record
                          ricavery

                          Troy,

                          I had tried numerous similar solutions in the meantime, without any success however...

                          My trigger script looks like this: Définir rubrique [Historique::IDnombre[Obtenir ( IDEnreg )]]

                          And the Conditional Formatting formula looks like this: Historique::IDnombre = Obtenir ( IDEnreg )

                          I have attached this formula to an empty text field placed just behind the row of fields to be selected.

                          I go into User mode and select a line --- no highlight!

                          Do you have any idea...

                          Richard

                          • 10. Re: How can I stop a portal jump to first record
                            tcmeyers

                            Richard,

                            I don't know French, so I can't tell if the commands aren't correct, so I will assume they are.

                            Everything looks OK. Is the script trigger attached to the Layout, as an  OnRecordLoad?

                            Is Historique::IDnombre a GLOBAL number field?

                            Besides setting up the Conditional Formatting formula of: Historique::IDnombre = Obtenir ( IDEnreg )

                            ...did you also select what kind of color change should occur?

                            Did you happen to put the empty static text behind something that totally covers it?

                            I can't think of other problems yet. It certainly does work here, on a real database. What version FM are you using to create the layouts? I'm using FileMaker Pro Advanced 11.0v2 for Mac. On the iPhone I'm using FMGo 1.1.2.

                            -Troy

                            • 11. Re: How can I stop a portal jump to first record
                              tcmeyers

                              Richard,

                              If the empty static text field is one pixel too high in the Body (so that it's not in the Body any more) then that could cause the trouble. In Layout mode, the top of it should NOT touch the dividing line between parts.

                              ???

                              -Troy

                              • 12. Re: How can I stop a portal jump to first record
                                ricavery

                                Troy,

                                After checking again and again, I cannot see where the problem could be...

                                I am using FM Pro 10.0V1 and FM Go for iPad.

                                I will keep checking everything again...

                                Richard

                                • 13. Re: How can I stop a portal jump to first record
                                  tcmeyers

                                  Richard,

                                  I do not think the difference between 10 and 11 could be it.

                                  If you like you could email the database to me (is it small?) and I could look at it.

                                  tcmeyers at troymeyers.com

                                  Please warn me here if you do so.

                                  -Troy

                                  • 14. Re: How can I stop a portal jump to first record
                                    tcmeyers

                                    I just checked on FMGo 1.1.2 for iPad and what I have done also works there.

                                    -Troy

                                    1 2 Previous Next