+<%INIT>
+if ($UpdatedLink and $Ticket) {
+ my $txns = $Ticket->Transactions;
+ $txns->OrderByCols(
+ { FIELD => "Created", ORDER => "DESC" },
+ { FIELD => "id", ORDER => "DESC" },
+ );
+ $txns->RowsPerPage(1);
+
+ if (my $latest = $txns->First) {
+ $UpdatedLink = "#txn-" . $latest->id;
+ } else {
+ undef $UpdatedLink;
+ }
+}
+</%INIT>