Description
Returns a Recordset object that contains the currency rate for a specified date and currency code.
See Currency sample.
Source table: ORTT.
Syntax
Visual Basic |
---|
Public Function GetCurrencyRate( _ ByVal Currency As String, _ ByVal Date As Date _ ) As Recordset |
Parameters
- Currency
- Specifies the currency code.
- Date
- Specifies the date for the currency exchange rate.
Return Type
A Recordset object that contains one field named CurrencyRate that holds the rate value.
SAP Business One returns 0 if the system cannot find the exchange rate.
Exceptions
-2000 The connection with the database has been disconnected.
Remarks
You can use this method to query the exchange rate between any currency and the local currency.
For example, if the local currency is US dollars, and you need the currency rate for EUR on January 10, 2002. Use the following line code:
vObj.GetCurrencyRate("eur", Date("10.01.2002"))
A result of 0.98 from the returned Recordset object means that on January 10, 2002 the exchange rate was 1 EUR = 0.98 USD.