What's wrong with my script?
I'm working with FM pro 10
I've created two layouts with two different tables, the first one is called "maintenance schedule" that contains 3 fields : Product SN, Client Name, Maintenance visit date. The second layout/table is called "Maintenance visit search" and contains one one field : Date
I want the second layout to perform a search on "maintenance Schedule" by entering a date value , this search should return as result the maintenance visits scheduled between the current date and the value entered in the field "date" on the "Maintenance visit search" layout. So I've made a script but it isn't returning right results:
If[IsEmpty (Maintenance visits search::Date )]
Show custom dialog [ "Enter Date";"Please enter a value"]
Set Variable [$$unit; Value:Maintenance visits search::Date]
Go to layout ["Maintenance List:(Maintenance schedule)]
Enter Find Mode 
Set Field [ Maintenance schedul::Maintenance Date; Maintenance schedule::Maintenance Date >= Get (CurrentDate ) and MAintenance Schedule::Maintenance Date <= $$unit]
If [not Get(FoundCount)]
Show custom Dialog ["No maintenance visits found"]
Go to layout["Maintenance visits search" (Maintenance visits search)]
What's wrong with my script??