AnsweredAssumed Answered

Open URL script step not working in a loop

Question asked by fotobymatt on Sep 11, 2018
Latest reply on Oct 9, 2018 by fotobymatt

I've spent most of today fighting with this, searching for solutions, but I'm at a loss, hoping someone with more experience might recognize where this script is failing.

 

The database: a master database holding tables for customers, products, sales calls, etc.

 

The task: create a copy of the database for each rep to access in FMGo. Limit the records in each database to only the appropriate rep by removing other rep's data from each copy.

 

I'm using a global field to store the rep number during this process, thus the first saved copy has "01", the second "02, etc. This global is then referenced in another script (RemoveOtherReps-Auto) which uses found sets to eliminate all records that do not match that rep number. This script is called as part of my startup script, so it runs if the file is opened for the first time with data in that global field. (The field is cleared out at the end of the RemoveOtherReps-Auto script, preventing it from running more than once.)

 

This works just fine for a single file, but once I enclosed the process in a loop the Open URL step stopped working. Sometimes it will open just the first file, sometimes none at all. Here's a screenshot:

 

Screen Shot 2018-09-11 at 12.40.04 PM.png

The loop works except for that one step. It successfully saves a copy for each rep, and I'm not getting any errors during the process. I've tried turning dialog on, tried using "auto-open" in the Save a Copy as step, tried moving the open command to a separate script, tried putting in pauses before, after, etc. but nothing changes the behavior.

 

Because the master database will be updated every month from our accounting software (customer changes, product changes, etc.) I have to export a new version of the file for each rep every month. I can deal with opening each file manually, only talking about 7 individual copies right now, but I don't understand why the script isn't opening them as designed.

 

Any suggestions?

Outcomes