This article is relevant if you are using NetSuite’s multiple currency rates and you are not satisfied with the default daily automatic price update feature.
Foreign Currency Exchange Rate Updates
NetSuite does a good job supporting over 190 different currencies native. Out of the box, you can ask NetSuite to update currency rates nightly. However, what do you do if you are not satisfied with the rates they provide or the frequency / timing for the updates? You can take matters into your own hands.
Three ways to Update Foreign Currency Exchange Rates
NetSuite offers three ways to update the foreign currency rates:
- Manually via the menu Lists, Accounting, Currency Exchange Rates.
- Via CSV Import.
- Via Web Services (NetSuite’s SuiteTalk).
How to Update NetSuite’s Currency Exchange Rates with SuiteScript
function scheduleCSVCurrencyUpdate(csvLine) { //csvLine represents a line of comma separated values of price information var mappingFileId = "CUSTIMPORT_rate_trx_csv"; // this references a saved CSV import map with header info below // add a header to the import var primaryFileAsString = "Base Currency,Currency,Exchange Rate,Effective Date\n" + csvLine; nlapiLogExecution('DEBUG', 'scheduleCSVCurrencyUpdate', csvLine); // create the CSV import job with a description that leverages the date var job = nlapiCreateCSVImport(); job.setMapping(mappingFileId); job.setPrimaryFile(primaryFileAsString); job.setOption("jobName", "MY_CURRENCY_UPDATE: " + new Date()); nlapiSubmitCSVImport(job); nlapiLogExecution('DEBUG', 'scheduleCSVCurrencyUpdate', 'Job submited!'); }
Hi Marty! For those who want to set alarms and receive notifications via email about their exchange rates, I recommend this online service https://exrate.today/
Hi John,
Thanks for this reference. The trick is to get this into NetSuite automatically.
Marty
Hi,
Could you give example csv contents for import job? I am tying to import currency rates following you example but getting following error:
Invalid transactioncurrency reference key “USD”.
Where my csv line is ‘EUR,USD,1.1506,05.10.2018’
Be sure to see how you are referencing currency definitions in the Lists, Accounting, Currencies menu. Once you solve it using standard NetSuite import approaches, you should be able to understand what you need to do for programmatic updates.
Marty