I'm wondering if my syntax is off. My varCreditRefundAmount is a positive value and when I add it to a new transaction representing a refund, I want to convert it to a negative amount.
This is what I'm doing:
newTransaction.ChargentOrders__Amount__c = varCreditRefundAmount * -1;
But I'm getting the error: Arithmetic expressions must use numeric arguments
Is it my syntax or could I be doing something else wrong? The value in the variable is a currency and the field I'm trying to send it to is also currency.
Thanks!
varCreditRefundAmount
is declared and set? Given the error, I suspect you've declared it as aString
, but the less that other people have to guess the more accurate the answers you'll get.varCreditRefundAmount
may be holding a string value that looks like a currency:'3.00'
for example - otherwise your logic is fine :)