3 Replies Latest reply on Dec 20, 2013 11:35 PM by synergy46

    Moving to specified field in a portal after data entry... possible?

    synergy46

      Title

      Moving to specified field in a portal after data entry... possible?

      Post

           I am using FM 12 04 Advanced on Windows.

           I have a portal called Dues.  It is related one to many with Members.  
           The fields on Dues are: 

           Date (Calendar Date)
           MembershipYear (calculated by script and inserted according to what Date was entered)
           AmountPaid (Numeric field)

           Dues portal is natively sorted DESCENDING on MemershipYear then by Date.

           The problem:

           For example, there are 2 entries  in the portal

           Dec 31, 2013  2015   $200
           Dec01,2013     2014   $150

           ...I enter Dec 15, 2013 in the bottom row of the portal.  If I commit the record, it sorts to the 'between' position.  And, even if I use GO TO Field (AmountPaid), FM can not go to the correct portal row because the CommitRecord has sorted the Dec 15 portal row and I have no way for my script to find the correct row number of the new portal row position.  (If I use Get(ActivePortalRow) it will show 3; the bottom row). 

           I KNOW I am over looking something ... Can you help?

            

            

        • 1. Re: Moving to specified field in a portal after data entry... possible?
          SteveMartino

               This may or may not help.  I have a layout with a portal (sorted descending).  I enter info in the main part of layout, when I tab into the portal I use an "OnObjectEnter" script trigger to perform the following script.  It auto enters the first field (date), commits record (to put most recent portal record on top)then stops on the next field.  At the end of the portal row I use a script to take me off the portal and back into the main layout.

                

          • 2. Re: Moving to specified field in a portal after data entry... possible?
            philmodjunk

                 Why does your script need to go to a field in a specific portal row?

                 Are you committing the record manually or as a step in a script?

                 If you are using a script, you can use get (activePortalRowNumber) to capture the row number before your script commits records and then your script can use that variable with go to portal row to return the focus to the correct portal row. Then Go to Field or Go to Object can put the focus in the correct field.

                 And if the script responsible is to calculated the membership year, you should be able to replace the script with a calculation and thus not need the script in the first place.

            • 3. Re: Moving to specified field in a portal after data entry... possible?
              synergy46

                   It looks like I was not clear.

                   The crux of the problem is that I can enter a date somewhere between the high and low dates in the portal date field.  (I can not tell what row the portal row will be on after commit).

                   Therefore I can not use get(lastportalrow) because it only tells me the row before commit   I could capture the pK of the new portal record and then 'find' it after it moves.  But, instead, i rearranged the fields so that the script trigger field is the last field be filled in.  That way I don't have to care where the sorted row ends up. 

                   Thanks for your ideas.