3 Replies Latest reply on May 15, 2014 9:55 AM by philmodjunk

    Portal field loosing focus...



      Portal field loosing focus...


           I have a portal into which I enter dues information.

           There is a script trigger that runs after the date is entered.  It calls the PaidYear 12 script which  calculates the current dues  year etc and it works.

           The problem is that if I enter a date for the current month in the portal I want the date script to first enter 0 (zero) for the Amount Paid and then run the PaidYear 12 script.  But, after FM comes back from the script, the current month is properly sorted with the current date at the top but if I type in a number it goes into the previous portal row at the bottom.

           Can you see what I am not getting?



        • 1. Re: Portal field loosing focus...

               You only show a little bit of the script and none of the "GOTO Paid Year          (12)" script so I can't be sure but the comment line:

               #The Last line of Goto PaidYear 12 is Commit Record.

               would suggest the reason why this is happening. A commit records step will cause the layout to no longer have the focus on a row of your portal.

               There are two possible "fixes":

               1) Redesign your scripts so that the actions that cause the loss of focus do not occur

               2) Save the portal row number at the beginning of the script (before focus changes) and use Go to Object, Go to Portal row, to return the focus to the original portal row at the end of the script. (Go to object is to put the focus on the correct portal should there be more than one, it only works if you use the Inspector to give your portal an object name.)

          • 2. Re: Portal field loosing focus...

                 Thanks for the reply Phil,

                 As you can see from the commented code, I tried the 'collect the portal number, go to object method without success.

                 What worked was exiting script with Exit Script (0).  Ba boom.... 

            • 3. Re: Portal field loosing focus...

                   I see no such thing in your script.

                   The steps that do that have all been disabled and do not execute.

                   And I've used the method I've described myself successfully any number of times.