Jump to content

Extracting search string from date fields in find mode


charper

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

Recommended Posts

I have a sales summary report that is used in the following manner:

In Browse mode they click on a button in the header labeled "Specify Search Criteria". This causes a script to run that puts them in Find mode and pauses. At this point the user can enter their search criteria for every field in the body of the report by selecting values off of pop-up lists attached to each field. I want this search criteria to be disaplyed in the header of the report when the report gets rendered so.......when the user clicks "Continue", the script copies this search criteria from these fields into a set of global fields displayed in the header using the Set command. Example:

Set (Sales Summary Item Name, Item Name)

Set (Sales Summary Item Category, Item Category)

Etc.

Then the script executes a "Perform Find" command. The report renders with the correct records in the found set and the global fields in the header displaying the search criteria that were specified - very nice.

There's one major problem though that's driving me crazy: One of the search fields in the body of my report is a date field: Item Date. While in find mode the user can enter a date into this field, continue the script, and everything works just fine i.e. the correct records are found AND the date appears in my global header field: Sales Summary Item Date. However, if the user uses any SPECIAL SEARCH CHARACTERS when they enter their date into the search field (such as >11/20/2000 or 11/01/2000...12/01/2000) nothing gets copied into the corresponding global field in my header. The report renders the correct found set but the global date field in the header is left blank. It appears that the Set command for this global field is not doing its job:

Set (Sales Summary Item Date, Item Date)

How the heck can I get the Item Date's search string into the global in my header?

I tried Copy/Paste but that doesn't work wither - Filemaker won't let you Paste into header fields.

Thanks for reading all of this. Hope someone can help.

-Charper

Link to comment
Share on other sites

I'd probably reverse the process and have the user enter the criteria into the global fields and then use these to set up the real fields in Find mode. Dates can be tricky. If you try to use a SetField[Date,"gDate1...gDate2"] to setup the find, it won't work. You'll need to have two global fields, one for start date and one for end date (You can just set a single date if only one field is filled out). In Find mode use:

Enter Find Mode[]

Insert Calculated Result[gDate1]

Insert Text ["..."]

Insert Calculate Result[gDate2]

Perform Find[]

Make sure the destination fields are on the current layout when the script is run.

-bd

Link to comment
Share on other sites

This topic is 8570 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
×
×
  • Create New...

Important Information

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