5 Replies Latest reply on Jan 25, 2018 2:09 PM by Andrew Cho

    Velocity script to retrieve latest custom object field

    Andrew Cho

      Hi all,

       

      I am currently having trouble trying to retrieve the latest custom object added.

      As an example,

       

      When someone lists their vehicle onto our platform a custom object 'Vehicle' is attached to the lead with a Listing ID.

      I want to get that ID to use in a link in the email.

       

      However I need it to return the latest custom object listing ID.

       

      From researching i see that something like this will work, however I am trying to fit mine into it.

       

      I am finding it difficult to fit it in ${Listing_cList.get(0).listingID}

       

      1. #if( $Listing && !$Listing.isEmpty() ) 
      2. #set( $firstItem = $Listing[0] ) 
      3. #set( $lastItem = $[$math.sub($Listing.size(),1)] ) 
      4. #end 

       

       

      Thanks for your time and effort to read through