Gary Weisbrodt Posted September 4, 2004 Posted September 4, 2004 Is it possible to script a find that changes a value in a field in the record? What I am thinking is that if I can find a set of records and change a value in one of the fields, say from 2 to 1 so that the set of records matching the find would have the value of 1 than a portal sorted on the field having the value of 1 would bring the found set to the top of the portal. Is this vaible?
-Queue- Posted September 5, 2004 Posted September 5, 2004 I'll assume you mean that after records are found matching the criteria, you want to set all of them with a certain value. This is easily done, either using Replace or a Set Field loop. However, it won't change the value for the omitted set, which may already have the value you desire. You would first have to reset the field for all records in the file, then perform your find and set the field. You might also loop using a relationship to test whether any records in the file already have the value and reset those, exiting the loop when the relationship no longer has related records. Perhaps if you explain a bit more what your purpose is, how you've set up the relationship for the display portal, and what you hope to achieve, we could offer better assistance.
Gary Weisbrodt Posted September 5, 2004 Author Posted September 5, 2004 I have a db of over 6,000 food items which I am making into an internet recipe making site. It is important that the useres select from the food items list as the db has nutritional informaton that calculates values for each recipe. The list is sudivided into about twenty food groups, However this still makes a rather long list of foods to select from. Mr. Fenton Jones has shown me a method in his Law Cases example to search and display records in a portal. I believe that the List and Table views that FM presents in IWP are too limiting for our purpose. i remembered that portals could be sorted and wondered if this was a viable option. I have tested Fentons example on the net with my food list and it performs nicely as far as I can tell. I has a problem when the search returns no records but a modification to the script should fix it. I just came across the ListManager example which presents a nice interface for selecting a group of records. I'll attach it for convenience. So, in short we are looking for the best way to select a few food items from many and present them as a recipe.
Gary Weisbrodt Posted September 5, 2004 Author Posted September 5, 2004 and here is the List Manager attachment
Fenton Posted September 5, 2004 Posted September 5, 2004 Yes, the example file I sent Gary did not have Set Error Capture ["On"] or a test for no records. It was a bare bones attempt to incorporate a Find, showing the results in a portal, rather than using a relational filter (which did not suit his data). I should have added those; it's easy, just a few steps. This was not the public LawCases example file which I posted in the Sample Files forum. That one is purely relational; there is no Find. I've been messing about with modifications of the basic technique. The first modification was to use the same basic filtered portal technique with Instant Web Publishing. It had to be changed from what works well on the desktop (no New Window, no Lock Loop, etc.). It works fairly well (other than the somewhat buggy performance of IWP, which will undoubtedly improve). It is useful, because it sidesteps the 5 record List view limit (which simply cripples IWP). I uploaded the IWP version in the Sample Files. Here's a link: http://www.fmforums.com/threads/download.php?Number=122302 I believe that a combination of the Category relational filter, then a subsequent Subcategory filter, with an optional "Find within this group," showing the results for either in a portal (well, 3 portals; but they'd all look the same :-) would be the ultimate selection technique for this type and quantity of data. I have not had time however to implement it.
Gary Weisbrodt Posted September 6, 2004 Author Posted September 6, 2004 Hi Mr. Jones Your work with me has been wonderfull. I appologize for the comment about Error capture in your example file. Sometimes I get in a hurry and say things the wrong way. I did realize that the example was ment to answer my question and not a complete solution.
Fenton Posted September 6, 2004 Posted September 6, 2004 Apology accepted. It was not so much that you'd pointed out where I'd committed an error of omission, it was that you were commenting on an example file which I'd sent you privately, in response to a private email from you. I didn't want people who'd downloaded the similar public file on the Sample Files forum to be looking for where their Find was going to need Error Capture [On], because that file didn't even have a Find. Your file did need Error Capture though, so I'm glad you caught that; and it was easy to add. Go look at the Sample Files forum. There is a enhanced file there that includes a Category filter, which we'd talked about earlier. I am also finishing up one which has an optional Subcategory filter as well. I feel that this "choose from list" is one of the most important interface aspects in the FileMaker, and that the built-in drop-down list or Find are not always the best method in large files. While we all try to make our files error-free, any example files I make (and I make a few) are for learning purposes. They are not really meant to be "plug and play" into your own solution. They are purposely as simple as possible to do the job, so you can see how it works without any extra clutter.
Recommended Posts
This topic is 7382 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