netsuite

Netsuite Advanced PDF - Display Country Name instead of Country Code


I have an Advanced PDF where I want to split the Billing Address into it's components, however when I use ${record.billcountry} I get "AU" instead of "Australia".

What is the method to display the Country name instead of the ISO code?


Solution

  • Here's a horrible hack, based on the assumption that the country is always the last line of the address:

    ${record.billaddress?keep_after_last(">")}
    

    It doesn't seem too easy to access the countries list to match the short names (the ISO code) to the full names from within the templates, but this works even if it looks horrid. The > is of course just the last character of the html line break <br /> which is in the address text, as passed to the template, between each line.