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

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

Recommended Posts

Posted

I'm creating a tickler database of tasks, and I'm having trouble writing a script that will perform a date range find. Basically, I want to push a button in my Contacts db that will then open the tickler database and show me the tasks that are due within the next seven days.

I can't figure out how to script the find for the current date, plus seven days?

Make sense?

Sorry if this is cake.

Dezza

Posted

Enter Find Mode [ ]

Insert Calculated Result [datefield, DateToText(Status(CurrentDate)) & "..." & DateToText(Status(CurrentDate) + 7)]

Perform Find [ ]

If [not Status(CurrentFoundCount)]

Enter Find Mode [ ]

Show Message ["No tasks are due within the next week."]

Show All Records

End If

Posted

Do you want to find all tasks that have a due date within the next seven days, or only those tasks that are due but not yet completed?

If the latter you'll need a "Completed" field as well as a "DueDate" field. For the script below, the Completed field is empty if it's not completed.

Enter Find Mode []

Insert Calculated Result [DueDate, DateToText (Status(CurrentDate)) & "..." & DateToText (Status(CurrentDate) + 7)]

Set Field [Completed, "="]

Perform Find [replace current found set]

Notes: the DueDate field must be on the current layout when the script is run. Also, the option "restore find requests" must not be selected for either the Enter Find Mode or Perform Find steps.

Posted

Thanks for the responses, but I must be doing something wrong. I enterd the script, as you've written, but FileMaker tells me there are no valid criteria in the request. What could I be messing up?

Posted

It is. I have only three layouts, and the the date field is on each one. I began the script by going to a new layout (which the date field was on), but when it didnt work, I deleted the layout and went back to the main page. Same problem.

Dezza

Posted

Are you using the Status(CurrentDate) function explicitly as stated? You must include DateToText( ) as well, or it will fail.

Posted

Can you attach a clone of the file? This makes no sense to me. I'd like to see it for myself.

Posted

While you investigate with Queue about this classic Find approach, here's another using relationships.

g_DateRange

c_ShowDateDue = Case(IsEmpty(Completed), Date, "")

Then the script.

SetField[g_DateRange,

DateToText(Status(CurrentDate)+1)&"

Posted

Remove the 'Restore find requests' check on Perform Find as Vaughan instructed earlier.

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