[SalesForce] Determine if instance has Multi-Currency Enabled

Is there a way to check if an instance has Multi-Currency enabled through the API?
I know that when enabling Multi-Currency, a CurrencyType object and multiple other fields are added on to each object.

Is there any other way other than querying for the CurrencyType object / CurrencyIsoCode on objects and then handling the INVALID_TYPE exception thrown when those fields are not in an instance without Multi-Currency enabled?

Thanks,

Best Answer

Boolean multiCurrencyEnabled = Schema.getGlobalDescribe().containsKey('CurrencyType');

If this check is true, it's safe to use CurrencyIsoCode fields and the CurrencyType object. I'd recommend using a static variable so it can be initialized just once per transaction.

Related Topic