How to change email template date format
change date format from mm/dd/yyyy to dd/mm/yyyy in netsuite email template
Original-${transaction.trandate}
Hi,
For an individual field, you can use this:
?string("dd/MM/yyyy")
Alternatively, adding this at the tope of your template should set the default string format for dates:
<#setting date_format="d MMM yyyy">
Thanks,
Chris
Thanks Chris for response!
But with this ${transaction.trandate?string(“dd/MM/yyyy”)}
I am getting following error
The template cannot be saved due to the following errors:
Syntax error in template “content” in line 3, column 46:. Encountered “style”, but was expecting one of these patterns:.
<TERMINATING_EXCLAM>
<DOT_DOT_LESS>.
“*” “?”. “??” “!”.
“T”. “(“.”)”.
Parse exception during template merging.
Are you able to share a larger section of your template?
Thanks,
Chris
I think something unexpected might have copied across. Could you please view the Source.
But when I simply print {transaction.trandate} it prints properly. I am not getting why error comes while converting.
Did you type ${transaction.trandate?string(“dd/MM/yyyy”)} or copy it from here?
If you copied it then it can sometimes bring across additional formatting, etc.
Now I tried by typing but then also getting same error
Apologies – could you try this:
?string["dd/MM/yyyy"]
i.e. square braces. I copied the code from some documentation but missed that.