Skip to main content
November 30, 2023
Solved

Currency Names

  • November 30, 2023
  • 1 reply
  • 0 views

Hi Everyone.

I am performing a conversion in a SQL query using currencies; I relied on this other post for now.

Where is stored the Currency Name ? 

The problem I have is that I have some SourceCurrencyId in the FXrates table that don't appear there, so I want to know if there's a way to get all possible currency names through a business rule.

Best answer by JackLacava

To retrieve a Currency object from an ID:

Dim objCurrency As Currency = BRApi.Finance.Cons.GetCurrency(si, currencyId)
BRApi.ErrorLog.LogMessage(si, $"Name: {objCurrency.Name}")
BRApi.ErrorLog.LogMessage(si, $"Symbol: {objCurrency.Symbol}")
BRApi.ErrorLog.LogMessage(si, $"Desc: {objCurrency.DefaultDescription}")

To retrieve all Currency objects:

Dim allCurrencies as List(Of Currency) = Currency.GetItems()

 

1 reply

November 30, 2023

To retrieve a Currency object from an ID:

Dim objCurrency As Currency = BRApi.Finance.Cons.GetCurrency(si, currencyId)
BRApi.ErrorLog.LogMessage(si, $"Name: {objCurrency.Name}")
BRApi.ErrorLog.LogMessage(si, $"Symbol: {objCurrency.Symbol}")
BRApi.ErrorLog.LogMessage(si, $"Desc: {objCurrency.DefaultDescription}")

To retrieve all Currency objects:

Dim allCurrencies as List(Of Currency) = Currency.GetItems()

 

MarcoAuthor
November 30, 2023

Thanks