March 12, 200718 yr 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 March 12, 200718 yr by Guest
March 12, 200718 yr 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
March 12, 200718 yr Author 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.
March 12, 200718 yr not Get (Found count) should be fine. It is basically returning a boolean value. Check the rest of your script steps.
Create an account or sign in to comment