0

I'm looking for a personalisation string/ampscript for Netsuite emails, where I want it to display a date that's 14 days after their end date.

So, if the end date is: 23 September 2020 - the date it should display is: 7 October 2020

Any recommendations for this? Quite new to Netsuite emails.

  • Don't remember NetSuite using AMPscript in email templates. Have used FreeMarker in NetSuite scriptable templates. Look those terms up in the NetSuite help to get started. There is also an [Apache FreeMarker](https://freemarker.apache.org/) reference available online. – Brian Sep 23 '20 at 15:34

1 Answers1

0

You can convert a date to a long and add milliseconds to that date to get a future date.

see https://freemarker.apache.org/docs/ref_builtins_expert.html#ref_builtin_numType and https://freemarker.apache.org/docs/ref_builtins_expert.html#ref_builtin_numToDate

so like:

<#assign startDate = record.trandate?long/>
<#assign futureTime = startDate + 14 * 86400000/><!-- ms per day -->
<#assign afterDate = futureTime?number_to_date/>
bknights
  • 14,408
  • 2
  • 18
  • 31