AnsweredAssumed Answered

Date and other fixed selection script

Question asked by michael_1 on Nov 15, 2010
Latest reply on Nov 15, 2010 by michael_1

Title

Date and other fixed selection script

Post

Hi all I have a script here which I copied from the forum posts (I'm not that bright in FM) and I want to search a selected date field and then two other fixed field entries in the one field.

If I disable the date section the fixed selection works as expected, if I disable the fixed selection the date selection works as expected but if they are both selected the date selection doesn't. Anyone comment on how to fix my stuff up.

Go to Layout [ “Sponsor” (Fuel report) ]
Enter Find Mode [ ]
Set Field [ Developer::gStart; Get ( CurrentDate )-28 ]
Set Field [ Developer::gFinish; Get ( CurrentDate ) ]
Show Custom Dialog [ Message: "Change date range"; Buttons: “OK”, “Cancel”; Input #1: Developer::gStart, "Enter Start Date"; Input #2:
Developer::gFinish, "Enter End date" ]
#
# If User selected 'Cancel' ... which is button 2
If [ Get ( LastMessageChoice ) = 2 ]
Go to Layout [ “Fuel report” (Fuel report) ]
// Halt Script
End If
#
# Now find records according to the range
#
Enter Find Mode [ ]
Set Field [ Fuel report::Date Start; Developer::gStart & ".." & Developer::gFinish ]
#
Set Error Capture [ On ]
#
Set Selection [ ]
Set Field [ Fuel report::Activation Type; "=Towing" ]
New Record/Request
Set Field [ Fuel report::Activation Type; "=Training" ]
Perform Find [ ]
Go to Layout [ “Sponsor” (Fuel report) ]

Outcomes