Gabe Posted February 13, 2005 Posted February 13, 2005 I am using the example in the filemaker book about using XML script parameters with the custom function GetParamXML to retrieve them. I am currently trying to make a button that will add a record to a join table, and I want to check to see if the record already exists in the table before I add it. The way I am currently trying to do it, I am doing a perform find where the id of the record matches the parameter passed to the script. The only problem is, I don't think that "Perform Find" allows calculations in the criteria field. So I guess my question is, how the heck do I do a simple search with data passed from a script parameter?
mr_vodka Posted February 14, 2005 Posted February 14, 2005 Maybe you can set a temporary global field with the script parameter and Perform Find based off the global value.
comment Posted February 14, 2005 Posted February 14, 2005 I don't think that "Perform Find" allows calculations in the criteria field. That is correct. However, Set Field does. So try: Enter Find Mode [ ] // NOTHING IS CHECKED Set Field [ yourtable::fieldtosearch ; Get ( ScriptParameter ) // OR WHATEVER CALCULATION YOU NEED Perform Find [ ]
Ender Posted February 14, 2005 Posted February 14, 2005 If you have a relationship from the parent table to the join table based on the parent ID, then you can see if there is a related record without performing a find: <From the parent table> If [ isempty(jointable::recordID) ] #No join record exists End If If your criteria for a "record already exists in the table" is more complex than that, you could add a Table Occurence with a multi-criteria relationship, then use the same type of test.
Recommended Posts
This topic is 7222 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 accountSign in
Already have an account? Sign in here.
Sign In Now