October 6, 20223 yr As part of a much larger applescript, I create a new record in FM and then tell FM to go to the new record, as follows... tell application "FileMaker Pro" tell document "XYZ" set newrecord to (ID of (create new record) as integer) go to record ID newrecord end tell end tell This works fine on my machine. However, when I connect the database as a shared database on any other machine (being shared from my main machine), it creates the new record but does not go to the new record, with the following error message: error "Can’t make id of «class crow» id 3.1354E+4 of window \"XYZ (iMac2020)\" of application \"FileMaker Pro\" into type integer." number -1700 from id of «class crow» id 3.1354E+4 of window "XYZ (iMac2020)" to integer So I tried the following... tell application "FileMaker Pro" tell document "XYC" set newrecord to create new record go to newrecord end tell end tell again it works to create the new record but will not go to the new record, with the following error: error "FileMaker Pro got an error: Object not found." number -1728 from record ID 3.1352E+4 of window "XYZ (iMac2020)" As part of the larger script I need to return and access numerous newly created records, hence the need to be able to specify the record to go to using the ID. Is there a workaround for this issue or does it look like it is just something that cannot be done if the database is accessed as a shared DB? FM 19, Catalina. Typically I've managed to solve it just after posting!! tell application "FileMaker Pro" tell document "XYZ" create new record set newrecord to ID of last record as integer go to record ID newrecord end tell end tell Hopefully will help someone in the future...
October 7, 20223 yr I don't know the answer to your question. I am just curious if you couldn't do simply: go to (create record) This should create a new record and select it all at once.
October 7, 20223 yr Author I just tried your suggestion. It creates the record but gives an error of the following: error "FileMaker Pro got an error: Object not found." number -1728 from record ID 3.1463E+4 of window "XYZ (iMac2020)" Below is the only solution I have found so far to create the new record and then get the record ID (for use further on in the script) when running the script on a machine which is accessing the Database being shared from another machine tell application "FileMaker Pro" tell document "XYZ" create new record set newrecord to ID of last record as integer go to record ID newrecord end tell end tell
Create an account or sign in to comment