FreeMarker/NetSuite PDF Template – Double sorting by date, with possible empty values

<table> <tr> <th>name</th> <th>quantity</th> <th>dateFrom</th> <th>dateTo</th> </tr> <!– Print entries with from/to dates –> <#list records?filter(x -> x.custcol_from_date?has_content && x.custcol_to_date?has_content)?sort_by(“custcol_to_date”)?sort_by(“custcol_from_date”) as record> <tr> <td>${record.name}</td> <td>${record.quantity}</td> <td>${record.custcol_from_date}</td> <td>${record.custcol_to_date}</td> </tr> </#list> <!– Print entries without from/to date at the end of table –> <#list records?filter(x -> !x.custcol_from_date?has_content || !x.custcol_to_date?has_content) as record> <tr> <td>${record.name}</td> <td>${record.quantity}</td> <td>${record.custcol_from_date}</td> <td>${record.custcol_to_date}</td> </tr>… Continue reading FreeMarker/NetSuite PDF Template – Double sorting by date, with possible empty values