In a pdf template (freemarker), how can I get the ...
# ask-stanley-ai
l
In a pdf template (freemarker), how can I get the full country name based on the country code, example, if I have "US" I would like to get "United States", same for other countries, if not possible, how can I make an if statement (if record.shipcountry === "US" return "United States") ?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that you can't directly get the full country name from the country code in a PDF template using Freemarker. However, you can use a conditional statement to return the full country name based on the country code. Here's an example of how you can do it:
Copy code
freemarker
<#if record.shipcountry == "US">United States<#elseif record.shipcountry == "AU">Australia<#elseif record.shipcountry == "GB">United Kingdom<#-- Add more conditions here for other countries --></#if>
This will check the
shipcountry
field of the record and return the full country name based on the country code. You would need to add more conditions for other countries as needed. Alternatively, you can use a SuiteScript to set a custom field with the full country name based on the country code, and then use that custom field in your PDF template. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831222
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830824
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.828690112
Please provide your feedback on this answer.