Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Difference in years in Freemarker / Scriptable Template
I'm trying to come up with a scriptable template where I reference the number of years someone has been in our system. I'm trying the following Freemarker code, but I cannot get the system to even accept this code when I hit save;
<#assign thisyear = .now?date>
<#assign thisyear = thisyear?string["yyyy"]>
<#assign thisyear = thisyear?number>
<#assign createyear = entity.dateCreated?date["yyyy"]>
<#assign createyear = createyear?number>
<#assign numyears = thisyear - createyear>
(I'm sure there's a better, more compact way of writing this but I'm new to Freemarker so I don't really care about that for the moment unless it solves the problem.)
0