December 10, 200223 yr Scenario: Running a script that automatically duplicates portal records in a loop, based off whether a field "Continue After Break" is checked. The solution is a "Time Tracking" DB that allows employees to log their times against certain orders and jobs. I am trying to implement a quick, one button way to log in and out of break, and automatically starting on the job the person was working on before break. Problem: After the script is run, it appears as if all the portals did not get updated with the new information. Selecting the entire portal row "refreshes" that row to what is really there, but I think it should just automatically update. Puting a Refresh command in my script does nothing for this problem. I suspect the problem may be related to the fact that I have two calculation-container fields using different colors and covering up unneeded information (see attachment). But I'm not sure. Any ideas? I will elaborate upon request, including posting the entire script. Mac OS 9.2.2 / FM Developer 6.0v3
December 10, 200223 yr Author I forgot to mention that I have the portal sort by: 1 Unstarted Job Entries ("blue" line items) 2 Active Job Entries ("green" line items) 3 Finished Job Entries ("gray" line items) 4 Start Time Sorry if this is a lot of information, but in the past I guess I have been to vague sometimes. I just think it's all a little daunting sometimes!
December 10, 200223 yr To get the portals to update, try any of these techniques: change into Preview mode, then back into Browse mode Change portal row -- say, previous then next exit the record
December 11, 200223 yr I ended up adopting the following Refresh Portal script in my template: # Only the rows touched or scrolled get updated! # So make sure you loop through all the rows that fit on a page. Go to Portal Row [select, First] Loop Go to Portal Row [select, Exit after last, Next] Exit Loop If ["Status(CurrentPortalRow) > 27"] End Loop Go to Portal Row [select, Last] Exit Record/Request Refresh Window [bring to front]
December 11, 200223 yr Newbies I use a script like Kennedy's. The thing I've found is, you only have to scroll through one more row than the size the portal is set to. So if your portal is ten rows long, you can use Exit Loop If ["Status(CurrentPortalRow) > 10"] and that works, but you still ahve to have the exit after last in case there are less than ten rows (or else the loop gets stuck).
December 11, 200223 yr Exactly... the reason I use 27? That's the largest portal that I could reasonably fit on any layout... so I use the one script for every layout in the file... rather than having a different "refresh" script for each layout... and rather than having to remember to adjust the script if I decide to make the portal one row bigger... and looping through an extra 17-25 rows is not going to be a noticeable performance impact.
December 11, 200223 yr Author Thanks all, I used the "running through the portal rows" method like you suggested, and it works.
Create an account or sign in to comment