grahama1970 Posted July 18, 2014 Posted July 18, 2014 I'm getting the error "Specified Table cannot be found" In a field script trigger, I seem to be incorrectly targeting a table even though I am double clicking it out of the field list The script is: If[not IsEmpty(Servetrack2014::QuickFind)] / /prevents searching for a null value// Perform Quick Find(Servetrack2014::QuickFind End If I do have two tables being used in the database. Does that cause problems?
LaRetta Posted July 18, 2014 Posted July 18, 2014 After the ServeTrack_2014::QuickFind)] you have / (spaces) / if you wish to insert a comment on a line, you must have them without the space between, i.e. // and remove the // at the end of the line. single-line comments must remain on same line as // add comment here
LaRetta Posted July 18, 2014 Posted July 18, 2014 Also, Perform Quick Find is a script step ... not a function. :-) Script: If [ not IsEmpty ( ServeTrack_2014::QuickFind ) ] Perform Quick Find [ bla bla ] Else ... whatever End If Hang in there, Graham, you'll learn to love this stuff!
comment Posted July 18, 2014 Posted July 18, 2014 Also, Perform Quick Find is a script step ... not a function. :-) What do you mean "also"? In a field script trigger, I am not sure where exactly you are (your title says "in a calc field", but that's not what your screen shot shows - based on the quote above, I'd say you are trying to define a triggered script's parameter. In any case, scripts are not written in any 'Specify Calculation' window. Scripts are composed in an 'Edit Script' window, which you'll get by selecting: Scripts > Manage Scripts… then clicking the [+New] button.
LaRetta Posted July 18, 2014 Posted July 18, 2014 I meant 'also' because I spotted two errors ... the first was improper use of the Comment (LOL) // and the second was defining Perform Quick Find in a calculation dialog. :-)
comment Posted July 18, 2014 Posted July 18, 2014 I spotted two errors Your tail light is broken. Also, the car has no engine.
LaRetta Posted July 18, 2014 Posted July 18, 2014 Yeah, I spotted the comment error first and thought that was the reason for the break. After looking again, I spotted the script step in the calc, LOL, so I posted again with 'also...' I appreciate the fine-tuning pick!! Keep it up!! So instead of posting 'also' (almost as a secondary afterthought), I should have recovered from my almost-oversight and added, "but the REAL problem is that you have NO ENGINE!" Is that better? I'm still laughing at the image of that car. Okay, no, I should have reviewed more completely before posting at all (I can get ahead of myself a bit) and then mentioned the missing engine FIRST since it was the most critical, LOL.
grahama1970 Posted July 18, 2014 Author Posted July 18, 2014 Hi Guys. Thanks for the responses and your patience. This script (if I can get the syntax right) is supposed to fire onObjectSave on the field QuickFind. Ultimately, after I learn my way around, I am looking to create a Google-like search bar within the layout. The steps to get to the Specify Calc window 1) Right Click the QuickFind field and select 'Set Script Trigger...." 2) Check OnObjectSave 3) Click the Edit Button next to the Option Script Parameter Window 4) Enter the script Even removing comments and the Perform Quick Find command gives the same 'specified table cannot be found error'. Any ideas? If [ not IsEmpty ( Servetrack2014::QuickFind ) ] End If
comment Posted July 18, 2014 Posted July 18, 2014 That is not how it works. You need to create the script first. Only then you can set up a script trigger that would cause the (already existing) script to run on some event, and - optionally - pass it a parameter.. Please make sure you have (at least) gone through the tutorial, before trying out stuff "by the feel of it". Filemaker is not an intuitive application.
bruceR Posted July 18, 2014 Posted July 18, 2014 There is no need to even set up a script parameter to do what you are doing. The process for setting up a triggered script is: Write the script that is going to be performed Then in the trigger setup; SELECT this script Then in trigger setup, optionally pass a script parameter. Â But to perform a quick find, you generally don't need a parameter. Â Since these are all basic steps in using ANY script, such as attaching a script to a button, it seems that you will need to review basics of how scripts are written and how they are linked to objects.
grahama1970 Posted July 18, 2014 Author Posted July 18, 2014 I finally figured it out. I thought you could write the code in the calculation field. Instead, it seems that Filemaker wants you to add pre-configured commands and construct a full script. With respect, if I've learned anything so far, it's don't fight the way filemaker does things. I'll read a bit more to get a handle on the FM way. Am nearly done with this project, and then, back to Angular, Sass, Bootstrap, Node, and an assortment of open source sql/nosql databases
Recommended Posts
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