I have to do a VF with a "total" field for Quotes in a multi-currency org.
Is there a way for me to obtain the
QuoteLineItem.UnitPrice in U$D regardless of the user's currency configuration?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Advanced Currency Management, the dated exchange rates don't apply to objects other than those related to Opportunities
Dated exchange rates are used for opportunities, opportunity products, opportunity product schedules, campaign opportunity fields, opportunity splits, and reports related to these objects and fields. Dated exchange rates are not used in forecasting, currency fields in other objects, or currency fields in other types of reports.
In this use case, what I've done in the past is define a shadow
Number field on the
Amount_USD__c and compute it manually using a beforeInsert/update trigger by fetching values from the
DatedConversionRate object. See this answer for an example implementation. You need to decide what "date" to use as the filter
You want the shadow field to be a
Number, not a
If using a non-advanced currency management implementation where currency rates are fixed (essentially, they are the current exchange rates), then ...
Then you can do SOQL
SELECT ... ConvertCurrency(UnitPrice), ... FROM QuoteLineItem