You can select the 'Modify Last Find' from the Records menu, and then add/delete/modify the original criteria.
The same function exists as a script step, if you want to script it.
Just do one thing
u may find record by script then go for constrain found set script step.
means found upon found by script.
it may be help you.
Thanks you both!
Suggestion by Sorbsbuster is what I have been doing so far but it is rather time consuming since my search involves having already put together 150 lines, therefore I need to modify each line every time I want to see how an item is doing within a different environment (i.e. add the field I want to interrogate) ...it is driving me nuts.
Suggestion by Atauf...I am not sure what you mean...I have tried "importing" search directly into script but when I get to second step in which I have to constrain analysis to only a field in relation to the 150 searched resuilts something does not work.
Could you be more specific, sorry, I am really thick on scripts.
At the moment I have:
"run search [default settings]"
"limit search to [default settings]"
The first search does not present any problems but the whole script process stops there.
Am I missing something? Do I need to link the two? Is this possible?
"it is rather time consuming since my search involves having already put together 150 lines, therefore I need to modify each line every time I want to see how an item is doing within a different environment (i.e. add the field I want to interrogate) ..."
It sounds like you have hard-coded data into your script so that it cannot be easily modified when you change criteria. If so, enter your selections into global fields (maybe using Custom Dialog) and then perform your search for these entries instead. But 150 lines of what? Script? I suspect that your structure is not normalized; either that or your script is doing a lot that it doesn't need to do.
run search [default settings]"
"limit search to [default settings]"
Essentially, after Run Search finishes and you have a found set of records and it fires Limit Search, Limit Search needs to be within a Constrain Found Set (suggested above by Atauf). We would need to see the Limit Search script (preferrably both) to be more specific. It would also help to understand the context in which this process is ran.
Hi all, and thanks for your posts.
My db has been built to collect and analyse data relating to finds coming from an archaeological excavation. Each artefact has fields with record excavation contexts/layers. The db has 9000 artefacts (4 different sub-categories). Attributes pertaining to each artefact (e.g. length, width, colour, decoration type, raw material type etc., each a table itself with fields of its own), vary depending on the artefact category, however the maximum number of attributes for any artefact is 42. Last thing that makes things complicated (I believe): most fields refer to a table with a variable number of fields organised with a number ID corresponding to a description (e.g. 0=not identifiable; 1=raw material A; 2=raw material B).
Problem: I need to search for a given artefact attribute (or more attributes at once):
- among all records (easily done with standard search option);
- among a selected number of contexts/layers
- after this last search I would like to be able to further narrow down or modify search by e.g. looking how an attribute behaves within that set group of records.
150 lines of script, yes. Since I need to specify in which layers I want the db to search, in this istance they are 150 different combinations of three different fields (Area, Context, Feature).
I have already gone through the identification of different groups made of a number of contexts/layers. I have saved them all as individual searches. I would like to be able to use them to search within them.
Since I could not find my way round it in search mode, I have:
1.run selected search (e.g. group A)
2.created a script with "run search ". Here when I go to select search the one just run appears by default (I only need to select all lines and add them to the script table). And so far so good: the script provides the search results.
3.created another script with "limit selected group ". Here, for instance, I want the db to look which of the selected record has a type A decoration. Therefore I select appropriate table and ID; e.g.: Decoration::=1 (since 1=decoration A).
Second script does not work. If I re-design search everything works wonders but it is of little use and stupidly time consuming.
In theory, I would like to be able to create searches or selections within which I can further look for fields that where not specified in that particular search. E.g. After having created a group of 10 contexts, I want to see which artefacts come from those context and...which raw material they are, which raw material and decoration, whcih raw material, colour and decoration.
At the moment I am exporting selected data in excel and I do it there, but since I have got through the pain of building a db I would like to use it.
Apologies for the lengthy explanation but perhaps things are clearer now...Forgot to say ( by now however is pretty obvious I believe): it is my first DB and my background is in humanities ...ehm.
"Forgot to say ( by now however is pretty obvious I believe): it is my first DB and my background is in humanities ...ehm."
But we need to see your file. If you can upload it somewhere (with a few dummy records or smart ones for that matter) then provide a link to it here. If you are not comfortable with doing that then let me know and you can send your file directly for me to review. It is best then to return to this thread and finish the overall discussion so that others, landing here with same issues, can see what we did.
I still suspect in my gut a lack of normalization here ... after all, you are background humanities and I am background databases. ;-)
Here's my penny-worth on a couple of side issues:
- I think you have used tables to create a lot of IDs and Descriptions which I think may have been just as well served by creating a Value list. If that's the case it would have made your relationship graph much easier to manage. Also your layouts list.
- Your find script is sort-of self-defeating by having two 'Perfrom Find' steps in a row - the second one will just completely over-write the first. Did you mean that to operate as the equivalent of manually entering a find request, then adding a second request?
Hi Sorbsbuster, and thanks!
I appreciate your first comment and I understand it since I have struggled with it since the very beginning. I wanted to have a mask with drop down menus with texts (I suppose these are the value lists you mention) linked to numbers to be displayed in the db fields. This choice I thought would be good for two reasons:
1. I could translate mask into another language without having to touch fields directly.
2. when visuallizing the db in excel-like mode or when having to export it in excel I could have had columns with numbers rather than text.
Anyhow...perhaps after I have finished my PhD I will take more time in going through it again and make it proper.
Script: yes I meant to first enter a find request and then adding a second request. The latter should look into the results of the first one, but not necessarily the fields which have been already search through. Is that clear? I am afraid English is not my first language and it is awkward at times...
Thank you in advance!
Your English is perfect, don't worry about that.
Two find requests are an OR search, so:
Enter Find Mode
Request 1 is Year = 2010
Request 2 is Country = Italy
will return you all records for the year 2010 (in any country) and all the records for Italy (in any year)
Two values in one request are an AND search
Request 1 is Year = 2010 and on the same Request Country = Italy
will return a list of those records where the record shows the country is Italy and on the same record the year is 2010
Scenario 2 will obviously return fewer records that scenario 1 (Oh, OK: if the only records for Italy are 2010 and the only 2010 records are all for Italy then they will be the same...)
Effectively in Scenario 1 the 2nd request adds more records to the found set.
In Scenario 2 the 2nd criterion (Country = Italy) searches within the first search (Year = 2010)
Archdb said, "I would like to be able to create searches or selections within which I can further look for fields that where not specified in that particular search. "
Then you want to EXTEND your found set which is saying, "Find me all of the records from the first find. And now ALSO find me the records from the second find and combine with the first."
To do it, open your script and select script-step Constrain Found Set and insert into your script after your original Perform Find. Click 'specify request' and your second Perform Find criteria should still be listed there (Core 1). Then for testing, just keep but disable the second Perform Find so you don't loose that long list of criteria.
Sorbsbuster nicely explained the difference between an AND and an OR search. And now you know how to EXTEND the existing set of records as well. This is also how you use the CONSTRAIN found set that I mentioned above (which will find within the existing found set). So with Extend, you will end up with all the records from first find and all the records from second find as well. :^)
Since you are creating EXTEND searches, you can create each 'core' search separately then reference them as sub-scripts, something like:
Perform Script [ FIND Core1 ]
Perform Script [ FIND Core3 ]
This will allow flexability with the numerous finds that you need to create, allowing mix and match. I should also mention that this (or these) scripts should be properly error trapped. Before each Perform Find and each Extend or Constrain, use this script step: Set Error Capture[On]. Then immediately after the last 'find' step, check if no records found. It might look like this:
Set Error Capture [ On ]
Perform Find [ restore ]
Extend Found Set [ restore ]
If [ Get ( LastError ) ]
... no records found,
Show Custom Dialog [ "No records found." ]
... Halt script or do whatever you wish if no records are found such as going back to original layout
... records found so enter the remaining steps here.
The complexity of the error trapping would depend upon what you wish to happen if there are no results from the first request, the second and so on. Set Error Capture [ On ] stifles the annoying 'no records found' dialog from FileMaker and allows you to make the script continue as you might wish.
Good grief, I made a major typo. I said, "To do it, open your script and select script-step Constrain Found Set and insert into your script after your original Perform Find. "
I meant select script-step EXTEND of course and not CONSTRAIN. Sorry for the slip in words.
Great! It works!
I am playing with it right now and you both have done wonders!
Thank you very much. I find the solution suggested by LaRetta really smart...I would never have got there (and it took me a bit to figure it out...ah ah...db & myself two different worlds!). Perhaps because I had already set a good number of searches it is rather easy to set "Perform find" script for them and retrieve already run searches scripts. Thank you!
Thanks to sorbsbuster too, I thought I had understood the difference between or & and, but in practice I had made a mess...so thanks 1 million!
I must admit I have not tried with "set error capture" on... I will do perhaps but at the moment it does not represent a problem to see that there are no records (in itself it is indeed important info for me!).
thank you again!