Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Perform find based on Custom Dialog

Featured Replies

  • Newbies

A Custom Dialog allows user input for "Initial Date" & "Final Date". These 2 dates are stored. I would like to create a script that uses a date range in order to find all invoices within that specified range by the user through the Custom Dialog variable # 1 & variable # 2. Nevertheless the Perfom Find [] within the script doesn't allow "Date" to use the stored value in those two variables (it is expecting a "valid" date and not the name of another date variable name). Any suggestions? How can you use the range specified by the user in the Custom Dialog in order to perform the find ? Thanks!

You can set the field in find mode instead of explicitly in the Perform Find script step.

If for example you are capturing your user selection into global fields then...

Enter Find Mode []

Set Field [ YourDate; gDateStart & ".." & gDateEnd ]

Perform Find []

  • 3 weeks later...

Would I use the same thing if I was setting a Perform Find Script to find records over 5 days old?

Wouldnt that be just adjusting the start and end dates?

Im confused how to set it for 5 days greater than today...

Sorry I dont know what you are asking. If you want to find records that have a date that start 5 days from now, your start date would be, 07/21/2009.

Try:

Enter Find Mode []

Set Field [ YourDate ; Get(CurrentDate) & ".." & Get(CurrentDate) + 5 ]

Perform Find []

Try:

Enter Find Mode []

Set Field [ YourDate ; Get(CurrentDate) & ".." & Get(CurrentDate) + 5 ]

Perform Find []

what does the [ & ".." & ] part of the code do? Forgive me I want to know how to come up with this not just the answer...

Its an indicator for a range.

http://fmhelp.filemaker.com/fmphelp_10/en/html/find_sort.5.6.html

Edited by Guest
added link

YourDate ; Get(CurrentDate) & ".." & Get(CurrentDate) + 5

The difference in Yourdate and Current date. Im not understanding this...

[color:blue]YourDate is the target field.

[color:blue]Get(CurrentDate) & ".." & Get(CurrentDate) + 5 is the calculated result.

See:

http://fmhelp.filemaker.com/fmphelp_10/en/html/scripts_ref1.36.39.html

when I input that as the calc in the set field it says its missing an operator where the semi colon starts?

You're not supposed to enter ALL of "that" as the calc - only the calculated result part.

I suggest again you study the help page I linked to.

Ohhhhhhhhhhhhhhh Still looks the same as what I was trying to enter in but you set the target... k i get it now...

But that calc doesnt pull the records older than 5 days. It only shows todays records.

When I just do a perform find based on that calc it shows no records when I have 3 over 5 days old in records.

Edited by Guest

that calc doesnt pull the records older than 5 days. It only shows todays records.

No it doesn't - you asked "how to set it for 5 days greater than today..." and it finds records that fall between today and 5 days into the future (inclusive).

I really need to pay more attention to how I ask things...

I need to go back into the past of 5 days...

I think that you have enough to go on to try and figure out the range starting from 5 days ago to the current date... ;)

Well -5 takes last five days. so I set this to omit these records and that will show me remaining right? Is this the proper way to do it though meaning the calc? Or does it even matter how you do it as long as you get the answer your looking for.

Well there are always many ways to do things.

For example, if you just want all records that are earlier than 5 days ago then you can use

Enter Find Mode []

Set Field [ YourDate ; "<" & Get(CurrentDate) -5 ]

Perform Find []

But then you talk about omitting them. Well you could stick in a show omitted only step or you can just find for the opposite.

Enter Find Mode []

Set Field [ YourDate ; ">=" & Get(CurrentDate) -5 ]

Perform Find []

Which will find all records greater or equal to 5 days ago...

I dont know what you are looking for...

  • 4 months later...
  • Newbies

Hi,

Hope you can help. I am customising the Task Manager template that comes as part of FMPro 10. I want to be able to find tasks with an open status with a due date between and including "Date A" and "Date B". I have read your above notes but I still don't understand how to do this. Do I need to setup new global fields or can I work with what the template already gives me.

Thanks in advance for any help you can offer

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.