Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Go To Record ID not working on shared file with applescript

Featured Replies

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...

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.

 

  • 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.