Leb i Sol Posted April 9, 2004 Posted April 9, 2004 Hello People! Perhaps a dumb question but how to get arround (be able to) enter into g_fields in Find Mode? to be more specific I am working on DateRange calculation and significant fields are: ---------------------- MyDate -date g_StartDate - global as date g_EndDate - global as date ---------------------- the idea is to use 'the range' script: ----------------------------------------- Enter Find Mode[] InsertCalculatedResult("REL::MyDate","DateToText(REL::g_StartDate)&"..."&DateToText(REL::g_EndDate)") ----------------------------------------- and then perform the find.... but the problem is that I have more than just date field on "search layout" and therefor need to be in Find Mode before I even type the Dates into Global (otherwise in Browse mode users can accidentaly edit the record)...if I stay in Find Mode Global do not retain value when eg. switching/tabbing from g_StartDate to g_EndDate.... Any thoughs? I would really hate to have a separate layout for just the date-entry and then redirect user to "other layout in Find Mode" where they can input the rest of the fields Thank you for your time! ...I am still learning so feel free to 'burn me' FileMaker Version: 6 Platform: Windows 2000
jscooper Posted April 9, 2004 Posted April 9, 2004 Just a thought: Instead of using global fields, use calculated date fields. Make them each = "". Then modify your script to be something like: Enter Find Mode[Pause] # allow the user to specify criteria InsertCalculatedResult("REL::MyDate","REL::StartDate &"..."&REL::EndDate") Clear[select;REL::StartDate] Clear[select;REL::EndDate] Perform Find[] They won't be editable, so no real data will ever be in them. Jeff
Leb i Sol Posted April 9, 2004 Author Posted April 9, 2004 hello jscooper! Thanx for the respond...I actually did try exactly that on the text fields and it worked but, I was advised (by developers more experienced than me on this forum) not to go calculations nor text as "crutial" asspect of InsertCalculatedResult step needs to incorporate DateToText and global fields (vs. calcluations) are advised...what do you think? What would be the downside of using calcs date fields (besides having to clear them before find is performed)! Many thnax!
Fitch Posted April 9, 2004 Posted April 9, 2004 You can use globals in Find mode. What you can't do is reference related fields like you're trying to do. Relationships aren't valid in Find mode, since you're not actually on a record.
Leb i Sol Posted April 9, 2004 Author Posted April 9, 2004 ahhh mr. Fitch that make compleate sense! edit note: it made no difference if I reference them in "actual file" the filds are stil not accessible to entry In Finde Mode (which is initiated Before entry) Much Obliged!
-Queue- Posted April 9, 2004 Posted April 9, 2004 That's correct. You have to set the globals in Browse Mode and then use them to Insert Calculated Result in Find Mode.
Leb i Sol Posted April 9, 2004 Author Posted April 9, 2004 Well my worst fears come true...this really is as I would have to separate "date entry" perform Find and THEN do a find on the rest of the fields....rather lame. I guess that a "solution" would be telling my users to count 3 dots while they enter the range-hence killing the whole concept of "1 search layout"...so much for being postivly suprised by FM on a friday... Than you guys! I think I will go with calculations as they provide "smoother" and more logical Search than Globals.... ....maybe there is a light at the end of it all
Ugo DI LUCA Posted April 9, 2004 Posted April 9, 2004 Well, One silly idea on this late friday... Have a layout where you'd input globals, faking Find Mode, all your global fields just having a "g_" prefix. Then, move to find mode, loop through your fields and insert the values Enter Find Mode GoToLayout[searchFindMode] GoToField[First] Loop If[not IsEmpty(GetField("g"&Status(CurrentFieldName)))] InsertCalculatedResult[,GetField("g"&Status(CurrentFieldName))] NextField EndLoop If [status(CurrentFieldName)="YourLastFieldinTab"] EndLoop PerformFind For sure I never tried this, but why wouldn't it work ? FileMaker Version: 6 Platform: Mac OS 9
Ugo DI LUCA Posted April 9, 2004 Posted April 9, 2004 I'm just curious. I'll do a test and post it if it works. FileMaker Version: 6 Platform: Mac OS 9
Leb i Sol Posted April 9, 2004 Author Posted April 9, 2004 Hi Ugo! Thanx for joining in on this post.....U nailed my point...that is just it! I would HAVE to make "g_replicas" of the fields involved in search...make another layout copy-paste-repleace into 'true' fields (now in Find Mode) keeping my globals (which BTW are now NOT editable anymore)....but common seriosly you have to agree that this is lenghty supliment for such a simple Enter Find Mode-Type-Enter process....or it might just seem "lenghty" as this was a long week.. Ayhow, inserting DateToText with Calcluations works (as suggested by jscooper)....I just don't know why people are objecting/ingonring it as a 'valid, easier,qucker....etc.' solution?
Ugo DI LUCA Posted April 9, 2004 Posted April 9, 2004 Well, at least the GetField() trick works. Then, you could have your 2 global dates fields in the criteria layout. The first step of the script should be modified to set the gDate global to somedate...somedate. Then, all data would move to find mode. If you need more requests, as well as omit, then use an external file, or repeating fields. It's tedious, but this is friday ! FileMaker Version: 6 Platform: Mac OS 9 FindMode.fp5.zip
Leb i Sol Posted April 9, 2004 Author Posted April 9, 2004 Hey I learned something new and this what it is all about this file reminds me a bit of your apporach to storing "search variables" and "back to layout with enterd search criteria in it"...hmmmm You have a great weekend!
S Molly T Posted April 16, 2004 Posted April 16, 2004 Not really a solution to your question, but reading this thread helped me work through a similar problem and I came up with this solution. Thanks for the help. dateRangeFinder.fp5.zip
Leb i Sol Posted April 19, 2004 Author Posted April 19, 2004 hey Molly...funny how certian threads "just hit you on time" ins't it!
S Molly T Posted April 22, 2004 Posted April 22, 2004 Yes certainly a 'timely' thread. Maybe not a real elegant solution but it worked for what I was trying to do.
Recommended Posts
This topic is 7589 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