mzimmers Posted February 5, 2006 Posted February 5, 2006 ...but I can't get the Perform Find script step to return the results that I think it should. I've read the online help half a dozen times, but I'm still lost. Can someone explain to me what I'm doing wrong? I've created a relationship between two tables. Based on the contents of a field in one record, I'd like to go to the "related" record in the other table. I first do a Perform Find step, then a Go To Related Record step. Am I skipping some vital step here, or taking something for granted? Thanks for any help... mz
Raybaudi Posted February 5, 2006 Posted February 5, 2006 Hi please, can you write your script steps exactly as they appear into ScriptMaker ?
mzimmers Posted February 5, 2006 Author Posted February 5, 2006 Thanks for responding...I would have gotten back sooner, but my daughter needed help creating a movie for a class project! I've tried multiple finds, all returning no records. I have one table called "Card", which contains a repetition of something called "label numbers." For each label number, there is a record in a table called "Repair." All fields are text (I could change this, but I don't think it's the source of the problem). There are two pertinent steps in the script. The first is a FInd Records step, and the criteria is Repair::label number: [== Card::label number[1]]. I hard-coded the number 1 into this in order to simplify the troubleshooting. I've also tried removing the "Card::label number[1], and putting in a string that I know matches one of the records, with the same result: I get an error dialog telling me that "No records match this set of find requests." The second step is a Go to Related Record [From table: "Repair"; Using layout: "Repair" (Repair)]. This of course fails, based on the error above. Like I said, I know I'm doing something totally wrong here, but the documentation on the Find Record step is pretty sketchy. Any help would be most appreciated. Thanks... mz
Vaughan Posted February 6, 2006 Posted February 6, 2006 The Enter Find Mode [] and Perform Find [] steps can save a find request, and this saved request replaces the current find criteria. In your script, make sure that the "restore request" option is unchecked in both the Enter Find Mode and Perform Find steps.
mzimmers Posted February 6, 2006 Author Posted February 6, 2006 Two questions: 1. Is it necessary to explicitly enter find mode, or will the Perform Find command do that for me? I hadn't been using the Enter Find Mode step, but the find seemed to initiate. 2. where is this "restore request" option? I don't see it. I'm running version 7.
Wim Decorte Posted February 6, 2006 Posted February 6, 2006 1. if you do a Perform Find and specify your requests in that script step (with the "specify" button) then you don't need to go to find mode. 2. the Restore = Specify Find Requests
mzimmers Posted February 6, 2006 Author Posted February 6, 2006 OK...so, in this case, I do want the "Specify find requests" option enabled, right? So far, I haven't found what I'm doing wrong yet. mz
mzimmers Posted February 6, 2006 Author Posted February 6, 2006 Another data point: I've tried the search on numeric fields, with success. The field I was working with originally is text...am I using the wrong comparison operator for text? Am I perhaps supposed to use the exact function or something similar? Thanks...I feel I'm getting closer... mz
mzimmers Posted February 7, 2006 Author Posted February 7, 2006 I am pleased to report that the problem has been solved. The missing ingredient seems to be the need for a "Go To Layout" step before the "Perform Find" step. Something that most people (but not me) would automatically know. Thanks for the help, everyone...I do appreciate it. mz
Echo33029 Posted February 13, 2006 Posted February 13, 2006 Actually I believe that there is something wrong with the Perform Find script step. I am trying to get it to find records that have the value "1" in a field and it is failing every time. I know that the record is there because I can see it in Browse mode and I can even find it if I Enter Find Mode and search manually, however the Perform Find script step cannot find it. This has happened to me on many occasions since switching to FM7 and using the options to build the find request right into the script. I have attached a simple file, 1 table, 1 field, 52 records. All of the records have a value of 1 in the field. The perform find script step in the included script cannot find a single record. If anyone can point out what I am doing wrong I would be grateful. Echo FindTest.zip
mzimmers Posted February 14, 2006 Author Posted February 14, 2006 Actually I believe that there is something wrong with the Perform Find script step. Echo Oh, please don't tell me *that*...I'm much happier thinking the problem is on my end! I've gotten the finds to work with embedded constants, and with the operators that FM supplies (like @ and *), but for the life of me, I can't get it to do a find based on criteria contained in another record (even a global). I've simplified this way down with the same results. What's really odd (and I posted this elsewhere today) is that I get a found count of 0, *and* an error code of 0. This doesn't seem possible. Still, my money's on cockpit error (since I'm the one in the cockpit). Anyone? This is really quite baffling to this newbie... mz
comment Posted February 14, 2006 Posted February 14, 2006 Try removing the space between "=" and "1". BTW, the "=" is really not doing anything when the search is in a Number field.
mzimmers Posted February 14, 2006 Author Posted February 14, 2006 Try removing the space between "=" and "1". BTW, the "=" is really not doing anything when the search is in a Number field. So...what's the correct syntax for using the contents of a field for a search criterion? Assume for a text field. Thanks...
comment Posted February 14, 2006 Posted February 14, 2006 You cannot use the contents of a field (nor a variable) to specify criteria in a find request - only hard-coded values. You need to switch to another method: Enter Find Mode[] Set Field [ yourTextField ; yourGlobalField ] Perform Find[]
mzimmers Posted February 14, 2006 Author Posted February 14, 2006 EXCELLENT!! Thank you SO much. I believe what is happening is, when you enter find mode, you can populate a "phantom" record with your search criteria and then execute a termless search. Is that essentially correct? Somewhere, in the online help, it should have said that (unless I'm the only moron to whom it's not obvious). I guess I do need to buy a book...any recommendations? I want something I can use more as a reference than a tutorial. Thanks again...you just made my night! mz
comment Posted February 14, 2006 Posted February 14, 2006 I believe that what you call a "phantom" record is actually a find request (and you can have more than one of those). I am not sure "termless search" is a good description. What happens is a simulation of what you would do manually: go into find mode, put some data in the field (perhaps, if doing this manually, you would paste a value you have copied earlier in Browse mode), and hit enter. That's exactly what the script does.
Echo33029 Posted February 14, 2006 Posted February 14, 2006 Well, removing the "=" worked. Thanks for the tip. Too bad that FM didn't think that this was worth mentioning. I have been a FM user/developer since 1990 and it still amazes me how FM just seems to ignore these little things. Echo
Recommended Posts
This topic is 7193 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