AnsweredAssumed Answered

TOKEN SCRIPT NOT WORKING!

Question asked by DeAnna Humphrey on Feb 11, 2019
Latest reply on Feb 12, 2019 by J Grant Gray

I have a token script that is working in one workspace but not in another.  The script for whatever reason is pulling the value of a different Salesforce field.  See screenshots below to see the error. 

 

Here is the script token I am using:

## First, covert the variable to currency format

#set($total = $number.currency($$$${lead.Bonus_Gift_Card_Amt__c})) ##our code from before, e.g., $121,237.10

#set($stringLength = $total.length() - 3) ##get the total string length and calculate what we want to keep, e.g., 8 --note the specific spacing between the commands here! screwing up the syntax will crash it (e.g. if you remove the space)

#set($totalb = $total.substring(0,$stringLength)) ##takes the sub string of just the first 3 characters, e.g., $121,237

## Then, for the email output

${totalb}

Outcomes