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.

Find between dates

Featured Replies

Hi all,

I have 2 date fields, StartDate and EndDate.

I would like to use these fields to use as a find for invoices by typing the start date and typing the end date and when the user tabs out of the end date a script would return invoices for only invoices between those dates.

I already have all invoices showing in a list view and would just like to shorten it.

Is there also a way to show only the current months invoices when the user first goes to this layout as the default and then let them chnge the dates as above?

Thanks in advance

Milton.

Hi Milton!

"...and when the user tabs out of the end date a script would return invoices for only invoices between those dates."

Not using a list layout. If you use a portal, it can happen automatically otherwise your Users will need to either click a button to run the script or use an event trigger. Here's what it might look like using a button (attached).

LaRetta

RangeCurrentInvoices.zip

  • Author

Thanks LaRetta,

I made the gStart and gEnd fields exactly as your example and I made the script the same as yours.

It still returns all invoices.

Do I have to do the self join thing?

I have no concept of how I can do this in a portal, I can send a copy of the db if required.

Thanks again

Milton.

Yep, Milton, you need to do the selfjoin thing because the script uses a step called Go To Related Record [ selfJoin ] instead of a find.

As to whether you can do this in a portal; I didn't explain how to do it in a portal because you indicated that you already had a list view you wanted to use. To make it work with your existing list layout, modify the GTRR ( Go To Related) script step as:

Go to Related Record [ 'the self join' showing records using 'your existing list layout' ] :wink2:

If you instead want a portal, place a portal based on the selfjoin directly onto an Invoices layout. Fill in dates in the gFrom and gTo (placed above the portal) and the portal will automatically filter for you ... that is ... after you create the selfJoin.

Edited by Guest
Added portal sentence

Hi Milky & LaRetta,

Sorry to jump on your post but this is just what I need (with slight adaptation) the problem I have with this is the specify calculation for the gEnd my system says I have too many or not enough () in the code window.

  • Author

Alex,

This is what I did

Date_script.jpg

  • Author

LaRetta,

I finally got it to work!!!!!

What I was doing wrong was setting up 2 self join tables with one of each of your relationships instead of setting the relationships in the Edit Relationship window.

Now........ Is it possible to have in the gStart field the first day of the month DATE altomatically entered as well as TODAYS DATE automatically entered in the gEnd field?

This would automatically only show this months invoices by default.

This would be of great benefit to me.

On another matter, in another db program there used to be a selection to do an action when the user left the field or pressed enter.

Is there any thing like that in FMP?

Thanks for all your help.

Milton.

Now........ Is it possible to have in the gStart field the first day of the month DATE altomatically entered as well as TODAYS DATE automatically entered in the gEnd field?

Uhm, Milton? That's what the script called Invoices This Month does. I assume there aren't invoices for the future? If so, you would need to change the second Set Field[] (the one setting the gEnd date) to [color:blue]Get ( CurrentDate ) only.

If I'm still missing something you need, please clarify!

LaRetta :smile2:

On another matter, in another db program there used to be a selection to do an action when the user left the field or pressed enter.

Is there any thing like that in FMP?

Not yet. :wink2:

And that's why I put that FILTER button there in case the User changed one of the dates.

Not Yet.

Okay now there is. See vs. 10 with event triggers just now announced here on FM Forums (although FMs website still doesn't show it - I checked before saying 'not yet.') :wink2:

Edited by Guest

It's happening as we speak:

http://www.filemaker.com/products/fmp/script_triggers.html

ROFLMAO!

I checked before saying 'not yet.')

But I didn't check again before responding the next time! Thanks, Michael!

  • Author

Which version of 10 do you need to create stand alone or kiosk mode?

I want to upgrade but can't find any mention of which one?

Milton

You need the Advance Edition.

Lee

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.