Jump to content

Go To Record ID not working on shared file with applescript


This topic is 560 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This topic is 560 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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