0

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.

6
  • How about webkul.com/blog/get-default-org-currency-apex? Mar 2, 2020 at 18:33
  • @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. Mar 3, 2020 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. Mar 3, 2020 at 13:16
  • have an apex rest endpoint that can be consumed by external systems? Mar 3, 2020 at 13:17
  • 1
    @PranayJaiswal found solution we can use connectApi. Mar 5, 2020 at 15:02

1 Answer 1

4

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);

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.