Jump to content

entering into Globals in Find Mode


This topic is 6486 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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' smile.gif

FileMaker Version: 6

Platform: Windows 2000

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Well my worst fears come true...this really is frown.gif 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.... smile.gif....maybe there is a light at the end of it all laugh.gif

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Hi Ugo!

Thanx for joining in on this post.....U nailed my point...that is just it! I would HAVE to make "g_replicas" frown.gif 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.. laugh.gif

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?

Link to comment
Share on other sites

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 ! smile.gif

FileMaker Version: 6

Platform: Mac OS 9

FindMode.fp5.zip

Link to comment
Share on other sites

This topic is 6486 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.