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

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

Recommended Posts

Posted (edited)

I have a script that gets the current date, adds 7 to it and then displays all medical appointments in the database that fall between the current date & current date +7 days. The script is working great as long as there are appointments that fall in that range. If there are no appointments it gives me a message that no records can be found, puts "3/12/2007...3/19/07" (the range it is looking for) and most concernsing, when I try to enter Find Mode in different layouts, I get booted out of Filemaker and have to restart it.

The current script is as follows:

Enter Find Mode []

Go to Layout ["MedAppTick" (MedAppoint)]

Set Field [MedAppoint::MedAppDate;Get(currentdate) & "..." & Get(currentdate+7)]

Perform Find []

Show/Hide status area [Hide]

Adjust Window [Resize to Fit]

Can anyone tell me how I need to adjust script to stop the problems described above?

Thanks

Edited by Guest
Posted

I am not sure why its crashing. Possible corruption.

As for the error, turn on Error Capture

Set Error Capture [ On ]

Show/Hide status area [Hide]

Go to Layout ["MedAppTick" (MedAppoint)]

Enter Find Mode []

Set Field [MedAppoint::MedAppDate;G et(currentdate) & "..." & Get(currentdate+7)]

Perform Find []

If [ not Get ( FoundCount ) ]

Go to Layout [original layout]

Show custom dialog ["Error"; "There are no records found... etc etc."]

Else

Adjust Window [Resize to Fit]

End If

Posted

Hi Mr. Vodka, Thanks for the quick response. i have a question about the If/Else/Iff.

Do I need to put anything else in the:

if [ not Get(FoundCount)]

When I enter this in scriptmaker it gives me the following response :)

"A number, text constant, field name or "(" is expected here".

Thanks.

Posted

not Get (Found count) should be fine. It is basically returning a boolean value. Check the rest of your script steps.

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