Velocity Script - How to evaluate for several values in a field
Dear Velocity Script masters,
I have a script where I am trying to evaluate if one of 3 values is present in a custom object field. If so then display a formatted date. Here is the script I have hacked together:
I have recently added lines 6 and 7, attempting to include the values AC_G or AC_S in the evaluation. Basically, I want the script to function for values AC_P or AC_G or AC_S. I have them commented out in this because as-is they do not work properly. Is my syntax wrong or should this be accomplished in a different way?
#set( $exp = ${lDISales_cList.get(0).lDIExpireDate} )
#set( $interestingItems = [] )
#foreach( $item in $lDISales_cList )
#if( $item.lDIRenewalEffortNumber.equals("1") )
#if( $item.lDIOrderClass.equals("AC_P") )
##elseif( $item.lDIOrderClass.equals("AC_G") )
##elseif( $item.lDIOrderClass.equals("AC_S") )
#set( $void = $interestingItems.add($item) )
#set( $ExpireDate = $convert.parseDate($item.lDIExpireDate,'yyyy-MM-dd') )
##$date.format('MMM dd, yyyy', ${display.list($interestingItems,"<br>","<br>","lDIExpireDate")})##
##${display.list($interestingItems,"<br>","<br>","lDIExpireDate")}
${date.format('EEEE, MMMM dd, yyyy',$ExpireDate)}##
#end
#end
#end
Thanks much Marketo Engage superheros!
Eric