0

I have a VF component that can show a list of orders with their items. These can be either loaded using SOQL or generated in memory based on some other data. I use <apex:outputField value="{!item.UnitPrice}" /> to display the price field. When the information is queried, everything works fine. But if I display the generated, non-saved items, they are displayed in the default currency.

The CurrencyIsoCode field of the order items is not writeable, so there's no way to actually specify it on the item itself. I've tried to set specify it through the order (orderItem.Order = new Order(CurrencyIsoCode = 'USD')), but that does not do the trick.

Is there a way to resolve this? Ideally I would like to keep using <apex:outputField> element since that also takes care of localization of the number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.