Hi Nation, I'm searching for a Velocity solution to get the most recent Lead Source when there is more than one. Using only ${leadSource_cList.get(0).source} does not get the most recent source on record but the initial one (when there is more than one source added to Lead over time).
Most grateful in advance,
Shawn
Solved! Go to Solution.
You should have an updatedAt field on your CO, so like so:
#if( !$leadSource__cList.isEmpty() )
#set( $mostRecentLeadSource = $sorter.sort( $leadSource__cList, "updatedAt:desc" )[0] )
Most recent is ${mostRecentLeadSource}
#else
No sources in list
#end
Please move this to Products to continue (Move link is at the right). This space isn't for support, it's for discussing the Champs incentive program itself.
Darn, sorry for that, moving now! Thank you!
You should have an updatedAt field on your CO, so like so:
#if( !$leadSource__cList.isEmpty() )
#set( $mostRecentLeadSource = $sorter.sort( $leadSource__cList, "updatedAt:desc" )[0] )
Most recent is ${mostRecentLeadSource}
#else
No sources in list
#end
Thank you, Sanford! I appreciate very much!
Shawn