Sorting Lists. Airplanes and Trucks.
I'm attempting to display a single list of airplanes and trucks sorted by due date. Airplanes and Trucks are each different forms. What is the best way to merge records from many forms into an array and sort the array? Here is my attempt and the point where things go sideways. Maybe Keys can help but i'm not sure. What do you recommend?
tx,tt
- //fetch records
- airplanes = Airplanes [Status == "Active"];
- trucks = Trucks [Status == "Active"];
-
- //create and fill lists
- vehicleIDs = airplanes.ID.getAll();
- vehicleIDs.addAll(trucks.ID.getAll());
- vehicleDates = airplanes.Due_Date.getAll();
- vehicleDates.addAll(trucks.Due_Date.getAll());
-
- //sort list
- vehicleDates.sort();
- //at this point after sorting the vehicleIDs list is now out of sync with vehicleDates
- //how do you combine tables and sort their records using Lists or Maps?