function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
forcetechsforcetechs 

Package Apex with Multi-Currency CurrencyISOCode

Is there any way to build an Apex Trigger/Class using CurrencyISOCode in a multi-currency org, such that it can be packaged for AppExchange but the currencyISOCode will be ignored in a non-multi-currency org where that field is not available?

I guess it will need some sort of dynamic Apex capabilities to determine the schema and behave accordingly.

Presently, it seems that Multi-currency becomes a pre-requisite for installing the package. Presumably this would mean two packages - one for multi-currency and one without - and ultimately two appexchange listings?
mtbclimbermtbclimber
Unfortunately no, when you reference a field or entity that is specific to a feature in the system we require that the target org has that feature enabled for your package to be installed there.

Our current plan calls for multi-currency to be the first conditionally supported feature of this kind so you could deploy a single package to both multi and single currency orgs. There is no timeline for this we can share at this time, however. For now you must create separate packages for each type if you wish to support both types of subscribers.

Regards,
PBS_IC786PBS_IC786

Has this been addressed?  We are facing this issue right now....please advise as necessary since we cannot describe the Account object to see if the Currency field is avaiable in the managed package.  We have customers who may or may not have multi currency and we would like to have only one managed package for all of them....

 

Thanks

A_SmithA_Smith
You should be able to use dynamic apex to see if the CurrencyISOCode field exists and then you can fork your behavior from there.  Keep in mind this trick only works in Apex.