So I have this code:
#if( $lead.autoPreApprovalNewRate.toString().equals("") )
#set( $lead.autoPreApprovalNewRate = 0 )
$number.number( $math.sub($lead.autoPreApprovalNewRate, "1") )
#end
And when there is a value in the
$lead.autoPreApprovalNewRate
field, this works beautifully. The problem is if they don't have a value, the programing makes sure it's a 0, and the subtraction turns it into -1. I'm sure there is just another #if #else... I'm just not able to figure it out.
Thanks.
Solved! Go to Solution.
Lot of confusing stuff here, and it’s just a few lines of code. 🙂
If your requirement is
then that's
#if( $lead.autoPreApprovalNewRate.equals("") )
#set( $outputRate = 0 )
#else
#set( $outputRate = $math.sub($lead.autoPreApprovalNewRate, 1) )
#end
${outputRate}
Lot of confusing stuff here, and it’s just a few lines of code. 🙂
If your requirement is
then that's
#if( $lead.autoPreApprovalNewRate.equals("") )
#set( $outputRate = 0 )
#else
#set( $outputRate = $math.sub($lead.autoPreApprovalNewRate, 1) )
#end
${outputRate}
Thanks for your help. Sorry for the delayed response. I didn't get the notification that you had tagged me.