Velocity token returning error | Community
Skip to main content
Travis_Schwartz
Level 4
April 20, 2022
Solved

Velocity token returning error

  • April 20, 2022
  • 2 replies
  • 2573 views

I created a token based off a prior one that I got help creating, but I keep getting an error with it and I've done all I can to adjust it. The solution is beyond my current knowledge base. I would love some help in understanding what I need to fix to make this token work.

 

We have a custom object that is called "account". What I am trying to do is the following:

1. Does the member have a custom object called "account"

2. If so, and the description field is ARROWHEAD VISA

3. Display the rate field for that account object.

 

Below is my token code I've tried implementing. I've ensured all relative boxes are checked as well.

#if( !$account_cList.isEmpty() ) #foreach( $account in $account_cList ) #if( $account.description.equals("ARROWHEAD VISA")) #set ( $newRate = $account.rate} ) #break #end #end #end ${newRate}

 The values I get when I drag each option are:

 

${account_cList.get(0).description} ${account_cList.get(0).rate}

 

Thank you for your assistance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

This is a syntax error:

#set ( $newRate = $account.rate} )

 

You meant to write:

#set ( $newRate = $account.rate )

 

2 replies

Jo_Pitts1
Community Advisor
Community Advisor
April 20, 2022

@travis_schwartz ,

Missing { on line 4

 

SanfordWhiteman
Level 10
April 20, 2022

I would say extra, not missing. 🙂

Jo_Pitts1
Community Advisor
Community Advisor
April 20, 2022

Correct... I skimmed the code a little to quickly 🙂

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
April 20, 2022

This is a syntax error:

#set ( $newRate = $account.rate} )

 

You meant to write:

#set ( $newRate = $account.rate )

 

Travis_Schwartz
Level 4
April 20, 2022

That did the trick. I knew it was going to be something obvious once it was pointed out.

 

Thanks a million.