Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Script behaves differently on first run vs second run


mckinlet
 Share

Recommended Posts

I feel like I am in bizzaro world! I have a script that runs to import registrations to our server-hosted database, but the first time it is run after opening the database it does not import the data as outlined in the field mapping - -but the second time it runs, it does! What would be causing this? I have never had a problem like this before...

 

Workshop Database hosted in Filemaker Server 9

The script step in question involves importing from "Import Records" table to "CMP Workshop" table

 

SCRIPT: _Import Person 1 Fields

# FIRST = Find records in Import Records Table that have not been imported to main table yet.

Go to Layout ["Import Records" (Imported Records)]

Perform Find [Restore]

If [Get (FoundCount ) = 0]

Exit Script []

End If

Set Variable [$DBLocation; Value: Get (FilePath)]

#

# THEN - Goes to CMP Workshop table to import the records.

Go to Layout ["Complete" (CMP Workshop)Import Records [Add; Mac Roman]

***This is the step with issues. The first time run, it does not select the correct layout to import FROM (Import Records layout) nor does it select all of the fields that have been mapped for import. If I run the script again, it does all of it perfectly as set up in the script.

Import Records Set Up as -

Specify File: #DBLocation

Import Field Mapping -

Source: Import Records

Import Action: Add new records

Target Fields: There are about 40 fields set up. First time through about 25 will import.

 

Link to comment
Share on other sites

  • 6 months later...

Posting this again, in hopes that someone might have an answer. I have just created a similar import in another database (and we have now upgraded to Filemaker Server 12 Advanced), and it is doing the exact same thing. The first time the scrip is run after opening the database, it does not select the designated table to import data from and does not have all of the matching fields indicated as set up in the script. But the second time the script is run, everything works fine. Any ideas???

 

Additional observation - - this ONLY happens this way when the database is hosted on the server. If I move it to my desktop the script runs fine.

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use