Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

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

Posted

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.

Posted

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

Posted

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

Posted

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

This topic is 7075 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.