Because some users may query the database directly using our Apex interface, Omnata has provided access to our multi-currency handling classes for Apex users.
These take the form of global classes that can be invoked from code outside of the managed package.
The following classes are used to carry currency-rated data. They are used in place of the standard sObjects (CurrencyType, DatedConversionRate) since these objects may or may not exist depending on the Org configuration.
omnata_sf.ConversionRate
Field name
Type
Description
The rate, relative to the corporate rate
The number of decimal places
omnata_sf.ConversionRateAtDate
Field name
Type
Description
The rate, relative to the corporate rate
The number of decimal places
The start date of this rate’s effective period
The date of the day after this rate’s effective date finishes
omnata_sf.CurrencyHelper
Contains logic for handling various multi-currency scenarios.
getDatedExchangeRate(String currencyCode, Date effectiveDate)
Returns a omnata_sf.ConversionRate object, containing the conversion information for the provided currency code, at the provided effective date.
This information will come from the DatedConversionRate Salesforce object.
Example usage (assumes existing multi-currency configuration in Salesforce):
getExchangeRate(String currencyCode)
Returns a omnata_sf.ConversionRateAtDate object, containing the conversion information for the provided currency code
This information will come from the CurrencyTypeSalesforce object.