Skip 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.

Omitting "Confirmed" records that are past date

Featured Replies

Hi all

I am trying to create a script that will find records that show "confirmed" on any of the services we provide and then omit records that are past todays current date. From there it will go to another layout and list all up and coming "confirmed" events.

I am having trouble omitting records that are past due.

Right now in my script I select to omit multiple records and then specify a calculation where I thought it would just be this "${1-4-2005NEW}:):Event date ≤ ${1-4-2005NEW}::todays date"

Thats not working.

Any help would be great! confused.gif

Enter Find Mode

Set Field [ myTable::DueDate ; ">=//" ]

Constrain Found Set

  • Author

Thanks, that was perfect for finding future records. Can you or anyone tell me how to keep only the records that say "Confirmed" on any of the four services we offer?

It didn't seem to let me find only the "Confirmed"

Aaron

It looks like a not-so-happy face, doesn't it?

...

The confirmed bit: do a multi-criteria search. Like this:

Enter Find Mode

Set Field [ myTable::ConfirmedForA ; "Confirmed" ]

Commit Records

New Record

Set Feild [ myTable::ConfirmedForB ; "Confirmed" ]

Commit Records

New Record

Set Field [ myTable::ConfirmedForC ; "Confirmed" ]

Commit Records

New Record

Set Field [ myTable::ConfirmedForD ; "Confirmed" ]

Perform Find

  • Author

Hey Rob, that worked perfect, but I can't combine them to work together. Can they be done together so they find all confirmed services and then omit the ones that are past this date?

Thanks for the help. I'm learning some good tricks for FMP thanks to you!

Aaron

  • 2 weeks later...
  • Author

Can anyone else chime in with some advice? Rob helped me a lot but I haven't heard back from him.

I have it to the point where my database will find all confirmed files but I can not get it to omit files that are past today date.

I've tried to put into the script and option to omit, but it does not execute the omit.

Any help would be great!

Aaron

Are you using Rob script? What dates are you wanting to KEEP in the found set.

Please correct me if I'm missing something.

If the Set field used (i.e. Set Field [ myTable::ConfirmedForA ; "Confirmed" ], etc are finding too much, you should using an AND search with each of them for the Dates You are wanting too.

In the case of field A, that Record Request would look something like this:

Set Field [ myTable::ConfirmedForA ; "Confirmed" ]

Set Field [ myTable::DueDate ; ">=//" ] [color:"blue"] Note:

same for the other two fields.

HTH

Lee

[color:"blue"] Note: I have not used a search for a date in v7 yet, and I don't have the time to test at the moment, but in earlier versions you would need to use the Insert Calculated Results, and DateToTex( Functions with date finds entered through scripts. I'm guessing this has been changed, as the tone of the post indicate that it was working before.

Aaron, is each service (where they are marked confirmed or not) a separate field? If you have structured your solution this way, are you going to add fields each time you add a new service?

If this is not how you are set up, we need to know that. Simply, as Lee points out, it is probably easier to find only those you wish to keep.

If you provide more specifics, we can make some suggestions. wink.gif

LaRetta

Ah heck ... just substitute your field names for this generic script:

Go To Layout [ your services layout ]

Allow User Abort [ Off ]

Set Error Capture [ On ]

Enter Find Mode [ ]

Set Field [ theDate ; " great.gif " & Get(CurrentDate) ]

Set Field [ Service1 ; "Confirmed" ]

New Record/Request

Set Field [ theDate ; " great.gif " & Get(CurrentDate) ]

Set Field [ Service2 ; "Confirmed" ]

.... etc ...

Perform Find [ ]

Then test for no records found and decide what you want to do from there ...

This is essentially pulling together everything you've already been told, searching for the records you wish to keep. I shy away from using // because it might not always work well when system settings change.

My original point is that, by having your services as fields, you will have to remember to adjust this (and all affected scripts) each time you add a service. And you are already bumping into the limitations of using fields to handle 'like' data, ie, 'confirmed services.' And believe me, you'll forget all the places you need to tweak your calcs and scripts to allow for a new service ... been there, done it. crazy.gif

I was originally thinking Constrain wouldn't save any steps for you but I am wrong. It will save you two lines and that's important. I think it might be quicker (more efficient) also but I have never speed-tested search variations.

Enter Find Mode [ ]

Set Field [ Service1 ; "Confirmed" ]

New Record Request

... repeat for each field to search then ...

Perform Find [ ]

Enter Find Mode [ ]

Set Field [ theDate ; " great.gif" & Get(CurrentDate) ]

Constrain Found Set [ ]

Constrain Found Set[] is new in vs. 7 and I can offer no backward comparisons ... I never had the need to use Modify Last Find[] in vs. 6.

And now I'm done talking to myself. grin.gif

LaRetta

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.