This section of the FreeMarker template is responsible for processing and formatting item dimensions (length, width, height) to three decimal places. The input string: 5″ x 4″ x 2″ Assign Original String: The dimensions of the item are stored in the dimensions variable. <#assign dimensions = itemLineDetails.dimensions /> Remove Double Quotes: To facilitate easier processing,… Continue reading Formatting Strings
Tag: Freemarker
Reserved Names in FreeMarker Template Language (FTL)
FreeMarker Template Language (FTL) is a powerful tool for creating dynamic web pages and emails, among other uses. However, like any programming or scripting language, it has certain reserved names that you need to be aware of. These names are keywords in FTL and cannot be used for top-level variables unless accessed using square-bracket syntax… Continue reading Reserved Names in FreeMarker Template Language (FTL)
Understanding Comparisons in FreeMarker Templates
When working with FreeMarker templates, you often need to compare values to determine equality or which value is greater. This guide will walk you through the basic comparison operations and how to use them effectively within your FreeMarker templates. The if Directive In FreeMarker, the if directive is used to evaluate conditions. The syntax for… Continue reading Understanding Comparisons in FreeMarker Templates
Points to Note While Removing ‘Free’ From Shipping Methods with Zero Rate
Removing the “Free!” text from the shipping method list displayed on the website on the checkout page using content management. We can only replace the text by blank space or any other alternative symbol or text. The Shipping methods with non-zero cost will be displayed in the UI, only zero-cost in shipping method the “Free!”… Continue reading Points to Note While Removing ‘Free’ From Shipping Methods with Zero Rate
Freemarker Formula for Advances PDF Template to convert date to user-preferred format.
The date provided to the Advanced PDF template should be a date time Object. ${receiptObj.trandate?datetime.iso?string(“dd.MM.yyyy”)}
Freemarker code to display a table on the entire page even if the data size varies.
Freemarker code to display a table on the entire page even if the data size varies.
Repeat a string n times in freemarker
Requirement: Need to repeat a string of characters n times, where n is a variable Solution: Use list to iterate a range:
FreeMarker Formatting Method
NetSuite formatting is lost when you customize NetSuite standard fields. If you print hard-coded values which came from a custom data source or were calculated from standard fields, the format will not be consistent with the format of standard record fields. When editing the template source code, the nsformat_() formatting method makes it possible to… Continue reading FreeMarker Formatting Method
How to remove duplicate elements in an array using freemarker?
We can use freemarker sequences. Probably not super efficient but I’ve used this to group close to max size lines on invoices and such.
Perform Date math in advanced PDF Template
Calculate date math in advanced pdf templates.