March 28, 200817 yr Sadly I've pretty much solved my problem minus my final step. Within my quote table I have two fields... one being "Search_Day_Start" and "Search_Day_End". Those are both used within a layout I have designed to have different variables you can modify and then clicking on a specific button to generate a report for it. A simple report that would be generated would taking the two dates selected by the user and then displaying all quotes generated within that time period. Within that script I broke the dates down into a text format and then used a few other various things to extract the day/month/year. I would then generate a line of text based upon what I pulled out of the two dates. 3/22/2008 and 3/25/2008 produces the line {3...3}/{22...25}/{2008...2008} I have confirmed that this part is working and the correct things are being created. But when I switch to my "report" layout, enter find mode and set the field which is "date_create" (A date type field) to what I generated.. I basically get the issue on the find when it says there is no valid criteria in the request... but if I modify my find and just paste in the text I generated it works fine. I'm posting a screen of my script to hopefully clear any of my nonsense up! I'm also not 100% bound to my own script. I'm sure I skinned the cat with a spoon here. -Jimmy
March 28, 200817 yr If the Search_Day_Start and Search_Day_End fields are date fields, I am pretty sure (I am not at my Filemaker machine right now to test this) that you could simplify this substantially: # Script to search for date range Go To Layout["MySearchLayout"] Enter Find Mode[] Insert Calculated Result["TheDateField"; Search_Date_Start & "..." & Search_Date_End] Perform Find[] The key is to use the Insert Calculated Result script step instead of the Set Field step. You certainly don't have to insert ranges for each part of the date. David
March 28, 200817 yr Author that seems to fix my problem. I'm glad its done in a much cleaner form. "The key is to use the Insert Calculated Result script step instead of the Set Field step. You certainly don't have to insert ranges for each part of the date." What is the main difference between these two steps to begin with? Obviously they do behave a bit different and I think it does answer one other question I might have had in the past on a similar issue. When you get into those script steps it appears they both have a prmop to insert a calculated result but I know they are different. Edited March 28, 200817 yr by Guest
March 28, 200817 yr There is no reason not use Set Field[] here. Insert Calculated Result[] requires the field to be on the layout.
March 29, 200817 yr Older versions of FileMaker did require the Insert workaround. I'm not 100% sure when they changed it, it may be just with FileMaker 9 -- but old habits die hard. E.g., does everyone know that you can now script Replace without going to a layout with the field on it?
March 30, 200817 yr Comment-- I see that it works as you mention. Since this was the main reason I knew to use Insert Calculated Result, can you tell me how or where it would now be useful? Vern-- It used to be that one used the Insert Calculated Result step for entries that wouldn't pass the field's validation (as when one wished to script in a date range in a Find). Obviously, that changed... David
March 30, 200817 yr how or where it would now be useful? Besides maintaining backward compatibility with scripts written in previous versions, it would be useful for those occasions where you want to insert something at cursor position, while keeping the cursor in the field - such as inserting boiler-plate text.
Create an account or sign in to comment