1 2 Previous Next 27 Replies Latest reply on Jun 27, 2017 9:29 AM by Magnus Fransson

    Have blank row at top of portal for new record

    JohnNiebler

      Hello all,

       

      I have a portal that displays contracts for clients.  I figured out how to sort it so the newest contract would be on top and all the rest flow down in descending order.  The problem I have, is I want the ability to add a new contract at the top instead of scrolling all the way to the bottom.  An empty row there would be the best. 

      Note: The way I got this to sort descending, is I created a ContractID serial number.  Filled in the serial numbers, then sorted descending in Portal Setup.

       

        • 1. Re: Have blank row at top of portal for new record
          keywords

          There is a technique for achieving this which I learned some time ago from someone on this forum (can't remember who, sorry, otherwise I could acknowledge them), but it goes like this:

          1.     Set the existing portal relationship to NOT allow creation of records. Sort this portal with most recent records at top.

          2.     Make a duplicate of the relationship to ALLOW creation of records.

          3.     Duplicate your existing portal, make it just a single row, and switch it to the new relationship, the one that allows creation of records.

          4.     Place this portal directly above the main portal on your layout, so it almost appears to be part of the main portal

          5.     Filter this portal using IsEmpty ( <portalTO::primaryKey> ) so that it contains only a single blank row. To create a record, just enter the data; as soon as you click outside the record the filter will remove this record and it will appear as the top row of the portal below, with a new blank row in the data entry portal.

          The two screenshots below show this in Layout and Browse modes deployed in a timesheet setup.

          Screen Shot 2016-10-10 at 8.43.37 AM.png

          Screen Shot 2016-10-10 at 8.50.09 AM.png

          7 of 7 people found this helpful
          • 2. Re: Have blank row at top of portal for new record
            macwombat

            Nice technique!

            1 of 1 people found this helpful
            • 3. Re: Have blank row at top of portal for new record
              Magnus Fransson

              Hi John,

               

              Sounds like you would be helped by my "Reverse presentation order" request.

               

              Best regards Magnus Fransson.

              1 of 1 people found this helpful
              • 4. Re: Have blank row at top of portal for new record
                JohnNiebler

                Thanks, Keywords.  This makes sense.  I've got everything in place, but can't get the IsEmpty() to work so that I have a blank line.  It's putting the same record as the first line of the "Don't allow creation of records portal" which is just below it.

                 

                Thanks,

                -John

                • 5. Re: Have blank row at top of portal for new record
                  Karen

                  I usually put a separate portal above with one line, for that purpose.

                  It could be for the 'potential' record available normally at bottom when create record is enabled for the TOC, or coupled with Add button.

                  Set filter to display ONLY the potential with not IsValid(Time::_KPid).

                  I also have variants where it displays the most recently edited or created.

                  As long as I'm mentioning single row portals' use them for filtering a summary from the child record below a filtered portal.

                  1 of 1 people found this helpful
                  • 6. Re: Have blank row at top of portal for new record
                    keywords

                    The key to the top portal filter is to filter out any record that contains data, leaving only the blank fields for a "potential" record (as expressed by Karen—and yes, Karen, "I usually put a separate portal above with one line, for that purpose." is exactly the method I described).

                     

                    The filter I use is as described in point 5 of my post: "Filter this portal using IsEmpty ( <portalTO::primaryKey> ) so that it contains only a single blank row." (NOTE: you could also use foreign key as your filter—it needs to be a field from the portal TO that has a value auto-entered when a record is created.) The effect of this filter is to remove from the portal any actual record, leaving only the "potential"record.

                     

                    If your setup isn't working, chances are you are not using the right field—coming from the right underlying table but the wrong TO, for example.

                    1 of 1 people found this helpful
                    • 7. Re: Have blank row at top of portal for new record
                      Karen

                      Yep. I wrote my similar response because the topic is still marked unanswered.

                      • 8. Re: Have blank row at top of portal for new record
                        JohnNiebler

                        Hi Keywords and Karen,

                         

                        I'm sooooo close!  I think.  Keywords, I followed your instructions.  What I have looks right, but it's not working so I'm missing something.  You say filter on PortalTO::primaryKey.  Here's my filter:

                         

                         

                        Tracker 2 is the second instance of the relationship, with Allow Creation of Records checked.  TrackerID is a number field that is autoserialized.

                         

                        Seems like this should work, but it's not.  I get the same record as the first row of my "Don't allow creation of new records" Portal.  Is Tracker 2::TrackerID not a valid PortalTO::primarykey?  (I'm not exactly sure what a PortalTO is.)

                         

                        Thanks much!  -John

                        • 9. Re: Have blank row at top of portal for new record
                          Karen

                          Not sure I follow, but make sure the field for isempty can NEVER be empty.

                          I made a demo where the top portal fails because of that. Isempty or not isvalid work on the other two.

                           

                          Never mind the other TOG in the file.

                          1 of 1 people found this helpful
                          • 10. Re: Have blank row at top of portal for new record
                            JohnNiebler

                            Yeah, here's my setup of TrackerID.

                             

                             

                            BTW, what's TOG?

                            • 11. Re: Have blank row at top of portal for new record
                              Karen

                              Sorry! Table Occurrence Group (but TOC for Table Occurrence) :P

                              1 of 1 people found this helpful
                              • 12. Re: Have blank row at top of portal for new record
                                JohnNiebler

                                Alright, I'll read up on TOC and TOG. 

                                 

                                I'm still fuzzy on why my filter isn't working. 

                                 

                                I'm filtering the portal, saying, only show records in which Tracker 2::TrackerID is Empty.  Yet, the portal is still displaying records that clearly have a value in TrackerID (See pic from few posts ago).

                                 

                                It appears that the problem isn't with the Field, but with the Filter.  Do I have the filter (shown above) formatted correctly? 

                                • 13. Re: Have blank row at top of portal for new record
                                  Karen

                                  Can you show a screenshot of the relational diagram? Thanks.

                                  • 14. Re: Have blank row at top of portal for new record
                                    BillisSaved

                                    Good morning keywords,

                                     

                                    I hope your day is going well. I have a question regarding your suggested solution, which is great by the way. It's my understanding that FileMaker transfers all related records to a given portal on a layout. If you configure a second relationship to allow creation of new records in the second portal, does that double the amount of related records transferred to the host? I'm just curious... Thanks and have a great day!

                                     

                                    God bless,

                                     

                                     

                                    Bill

                                    1 2 Previous Next