Help with Custom Object Velocity Script

NomadZocdoc
Level 1

Hi there could use some help with troubleshooting some velocity script issues we are running into. We have a custom SFDC object that is related to the Person record via the account. We have checked off the fields used in the script as well as the company field. Here is the script we are trying to get to populate a date field:

 

## standard Velocity date/time includes
#set ($company=$lead.Company)
#set ($practice=$lead.Practice__c)
#set( $defaultTimeZone = $date.getTimeZone().getTimeZone("America/New_York") )
#set( $defaultLocale = $date.getLocale() )
#set( $calNow = $date.getCalendar() )
#set( $ret = $calNow.setTimeZone($defaultTimeZone) )
#set( $calConst = $field.in($calNow) )
#set( $ISO8601DateOnly = "yyyy-MM-dd" )
#set( $ISO8601DateTime = "yyyy-MM-dd'T'HH:mm:ss" )
#set( $ISO8601DateTimeWithSpace = "yyyy-MM-dd HH:mm:ss" )
#set( $ISO8601DateTimeWithMillisUTC = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" )
#set( $ISO8601DateTimeWithMillisTZ = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" )
#set( $SpendReach = $Practice__cList.get(0).SPO_Start_Date__c)

## Corrected date parsing using $dateTool
#set( $dateIn = $dateTool.parseDate($SpendReach, $ISO8601DateOnly, $defaultLocale, $defaultTimeZone) )

## Corrected date formatting pattern with single quotes
#set( $dateOut = $date.format("d MMMM yyyy", $dateIn, $defaultLocale, $defaultTimeZone) )

 

 

However, in our emails it just remains blank even when sending to records that have a date. Let me know if I should add to another discussion thread.

11 REPLIES 11