AnsweredAssumed Answered

Help with Script

Question asked by ChrisJones_1 on Jun 29, 2013
Latest reply on Jul 1, 2013 by philmodjunk

Title

Help with Script

Post

      

      

     Hi

      

     I wonder if someone can help me with a script I'm struggling with. I have got the script below to summarise the total amount of clients we transport between any given dates and to count the number of vehicles used to transport them using two Summary Fields in a table called Journeys. 

      

     The first summary field counts the vehicles used i.e minibus, DAR or a car and the second one just totals the amount of clients transported which is extracted from an input field on the journeys layout which is then displayed on another layout called 'clients transported' via a button on the journeys layout. 

      

     This works fine but what I'd like to do is summarise the amount of clients transported by vehicle type i.e 6 by DAR, 20 by minibus and 12 by car on the clients transported layout but I just can't work out how to do this so any help would be greatly appreciated.

      

Show Custom Dialog [ Title: "Clients Transported"; Message:
     "Enter the Start and End Date for the month required in the search fields below."; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No”; Input #1: Journey::gStart Date, "Start Date"; Input #2: Journey::gEnd Date, "End Date"; Input #3: Journey::Vehicle, "Specify Vehicle" ]

If [ Get (LastMessageChoice) = 1 ]

Enter Find Mode [ ]

Set Field [ Journey::Start Date; Journey::gStart Date &"..."& Journey::gEnd Date ]

Set Field [ Journey::Number Travelling; Journey::Vehicle = "Car" ]

Set Error Capture [ On ]

Perform Find [ ]

Sort Records [ ] [ No dialog ]

Go to Layout [ “Clients Transported” (Journey) ] 

End If

If [ Get (LastMessageChoice) = 2 ]
Go to Layout [ “Journey” (Journey) ]

End If

     Thanks in advance.

Outcomes