Interface for remote FileMaker database

I am creating a new Applescript Studio application so that my users can submit a tech request that will be entered into a database I have created. The interface is simple. The person just enters a username and problem into a respective text field and then selects a priority from a combo box. The code I use to enter the information into the database is as follows:

tell application "FileMaker Pro"
	set theRecord to create new record at the end of the records
		if theName is not "" then
			set cellValue of cell "userName" of theRecord to theName
			set theName to cellValue of cell "userName"
		end if
		if theProblem is not "" then
			set cellValue of cell "problem" of theRecord to theName
			set theProblem to cellValue of cell "problem"
		end if
		if thePriority is not "" then
			set cellValue of cell "priority" of theRecord to theName
			set thePriority to cellValue of cell "priority"
		end if			
	on error
		delete theRecord
		tell me to display dialog "FileMaker refused to insert the new entry." buttons {"Abort"} default button 1
	end try
end tell

When I click the submit button on the application, i get the following (very unhelpful error: NSReceiverEvaluationScriptError: 4 (1).

Any help would be appreciated :slight_smile:

Are you telling FileMaker what database it should use?

tell app "FileMaker Pro"
   tell database "Name of your database"
      set theRecord...

NSReceiverEvaluationScriptError means that the object or objects specified by the direct parameter to a command could not be found. Clear it up? :slight_smile:

But if FM doesn’t know the database then it can’t find the correct record.

Yes, I have this at the top of the code in another function.

on will open theObject
tell application “FileMaker Pro” to set userrequests to records of database “UserRequests”
end will open

Does it matter that I am accessing a database on a remote machine? I realized in a bit of genius that I needed to probably have the database open on my local machine to put a record in it, but i still couldn’t get it to work.

Ideally, the user will just be able to add a record to the database from their machines and it will just post it in the remote database. I have a web interface presently that accomplishes this using CDML.