Anybody here a fair hand with Freemarker? I have a...
# suitescript
t
Anybody here a fair hand with Freemarker? I have a suitelet that creates a sublist which sources data and takes user input, and generates a packing list. One of the user-inputs is "Pallet number" to indicate which pallet in a shipment each line item is on. User wants the PDF sorted by pallet number. In the template i'm using ?sort_by on the list, however it seems to sort them as strings despite the sublist field being set to integer, so 11 appears before 2, etc.
b
what about
sort
instead of
sort_by
?
sort_by
requires hashes, but
sort
supports numeric. https://freemarker.apache.org/docs/ref_builtins_sequence.html#ref_builtin_sort
t
I'm not sure
sort
will work as sub-variables don't all share the same data type, and any attempt to call it with similar syntax as sort_by (passing it a column to sort by) seems to break the rendering