SOLVED

Velocity token returning error

Go to solution
Travis_Schwartz
Level 4

Velocity token returning error

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity token returning error

This is a syntax error:

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

 

You meant to write:

#set ( $newRate = $account.rate )

 

View solution in original post

5 REPLIES 5
Jo_Pitts1
Level 10 - Community Advisor

Re: Velocity token returning error

@Travis_Schwartz ,

Missing { on line 4

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity token returning error

I would say extra, not missing. 🙂

Jo_Pitts1
Level 10 - Community Advisor

Re: Velocity token returning error

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

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity token returning error

This is a syntax error:

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

 

You meant to write:

#set ( $newRate = $account.rate )

 

Travis_Schwartz
Level 4

Re: Velocity token returning error

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

 

Thanks a million.