Has anybody had issues using 'DEFAULT' or the subs...
# suiteql
m
Has anybody had issues using 'DEFAULT' or the subsidiary.currency from the transaction when converting currency?
Copy code
BUILTIN.CURRENCY_CONVERT(transactionLine.foreignamount, 1, transaction.trandate ) - works
BUILTIN.CURRENCY_CONVERT(transactionLine.foreignamount, 'DEFAULT', transaction.trandate ) - Search error occurred: Cannot build builtin function, validation failed. Target currency id is not NUMBER but STRING
BUILTIN.CURRENCY_CONVERT(transactionLine.foreignamount, subsidiary.currency, transaction.trandate ) - Search error occurred: Cannot build builtin function, validation failed. Invalid target currency id argument
t
@Matt Bernstein Is it possible that the transaction's currency and the subsidiary's currency are one and the same - and this the weird error? Maybe try hard-coding the ID of another currency to see what happens. Also, there are a few queries here that might help: https://timdietrich.me/blog/netsuite-suiteql-currency-exchange-rates/
m
the transaction currencies were different on the ones I was testing with and need the subs currency but I can't hardcode the 1. The default date for currency_convert is todays date but I want the transaction's date. I'm using this for now
transactionLine.foreignamount * transaction.exchangerate
Odd 'DEFAULT' wouldn't work though as the documentation says you can use it for any value except the amount