I am unable to get a Filemaker record by ID using AppleScript

I am scripting FileMaker pro in Applescript - all was going great until I hit a wall. I can get records from any table matching any field against its value EXCEPT for the ID - which is a bit of a deal breaker. I have tried dozens of ways and they all fail - generally with an error -1728.


This is example code:


on getRawDBDRowTest(DB_DEF, _id)
	local rowCount, rowID, i, allRaw
	try
		tell application "FileMaker Pro"
			activate
			tell database the (dbName of DB_DEF)
				tell table the (tableName of DB_DEF)
					go to layout the (tableName of DB_DEF)
					set rowCount to the count of records
					if (rowCount > 0) then
						set rec to every record whose cell "taskID" = _id
						return rec
					else
						return {}
					end if
				end tell
			end tell
		end tell
	on error errTxt number errNum
		if errNum is equal to -1728 then
			--No results
			return {}
		else
			error "DBUtils/getRawDBDRow
" & errTxt
		end if
	end try
end getRawDBDRowTest


This is my field definition:



I can confirm that I have valid GUIDS in my data:



I have lost a full working day on what should be a simple thing - any pointers?



MacBook Pro 13″, macOS 10.15

Posted on Jun 4, 2023 11:03 AM

Reply

Similar questions

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I am unable to get a Filemaker record by ID using AppleScript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.