1 of 1 people found this helpful
Hey Alex, sorry for the delay. Usually get to these quickly!
The answer is to filter the list by only those that have "SCHEDULED." Velocity forces us to be clunky (there's no shortcut like ArrayList.filter() because you can't use predicates in VTL... but I digress) but it works:
#set( $appointment_cList_scheduled =  ) #foreach( $appt in $appointment_cList ) #if( $appt.orderStatus == "SCHEDULED" ) #set( $tmp = $appointment_cList_scheduled.add($appt) ) #end #end #if( $appointment_cList_scheduled && !$appointment_cList_scheduled.isEmpty() ) #set( $firstItem = $appointment_cList_scheduled ) #set( $lastItem = $appointment_cList_scheduled[$math.sub($appointment_cList_scheduled.size(),1)] ) #end $lastItem.appointmentDate
Flawless! You, kind sir, are a gentleman and a scholar. Thank you!!!