Suppose you have objects Customer and Invoice. Invoice has a lookup to to Customer, which means each Customer can have to multiple Invoices. Considering that:
- Multi currency is enabled.
- Customer can be set to any of the available currencies.
- Invoice can be set to any currency, independently from it's customer.
- Invoice has a Currency field with its value.
I need to sum the value of each customers invoices in an Apex Trigger, doing appropriate conversions of the currency of each Invoice to the Customers currency.
I have this working using number fields, but now need it to work with currency fields.
Is this possible at all without needing anything crazy (such as calling external services to get exchange rates)?