-2

I know we can use userinfo.CurrencyIsoCode to get currencycode for user in multi currency org. For single currency org we can manually look into company information and see currency locale. https://help.salesforce.com/articleView?id=admin_currency_set_locale.htm&type=5

But is there any way we can use apex to get currency code for single currency org's. I checked both organization and user object if there is any field for default currency but there is no field. Currencytype object is also not enabled in single currency org.

I need to know if there is any other salesforce object from where we can get this information. I don't want to create a custom object where admin can store this information.

  • @cropedy I am not asking same question. We are building a application that is not in salesforce but need currency details from salesforce. I have already mentioned in my question that I need solution for single currency org. In the solution given in question you marked as duplicate we are using a custom object where we have to store currency type of user. I wanted to know if there is any salesforce object from where I can get this detail. Please check my question again. – Manjot Singh Mar 3 at 13:15
  • @PranayJaiswal No this blog will not solve my problem. I know solution for multi currency org. I need to know something for single currency org. Thanks. – Manjot Singh Mar 3 at 13:16
  • have an apex rest endpoint that can be consumed by external systems? – Pranay Jaiswal Mar 3 at 13:17
  • 1
    @PranayJaiswal found solution we can use connectApi. – Manjot Singh Mar 5 at 15:02
1

We could use connectApi to get currency details. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_features.htm

We can use default​Currency​IsoCode in ConnectApi.Features to get iso code.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_output_usersettings.htm

We can use currencySymbol in ConnectApi.UserSettings to get currency symbol.

ConnectApi.OrganizationSettings  orgSettings = ConnectApi.Organization.getSettings();
system.debug(orgSettings.UserSettings.currencySymbol);
system.debug(orgSettings.features.defaultCurrencyIsoCode);
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.