AnsweredAssumed Answered

What's wrong with my script?

Question asked by Elie on Jan 31, 2010
Latest reply on Jan 31, 2010 by comment_1

Title

What's wrong with my script?

Post

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"]

Else

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]

Perform Find[]

If [not Get(FoundCount)]

Show custom Dialog ["No maintenance visits found"]

Go to layout["Maintenance visits search" (Maintenance visits search)]

End If

End If

 

What's wrong with my script??

 

 

Outcomes