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
Koen (BvD)Koen (BvD) 

How to obtain the currency for organisations that are not multi-currency

I see that the support for currencies (for example for annual revenue field on the account record) is not enabled for all clients of salesforce. How can I get the currency used by an organisation when this feature is not enabled? The only thing I can find that is filled in is the currencysymbol property of the GetUserInfoResult object. Am I really to program a table that maps these symbols to currencies? Is this even a one to one relation? Can't I just get the currency iso code for that organisation? The  field userDefaultIsoCurrencyCode is null, so it isn't there. Where or where can I get this?
 
Thanx
Koen.
Sami CohenSami Cohen

Hi,

I have posted the same message almost.
I resolved this issue by creating a simple page that contains a currency field.

<apex:outputField value="{!myCurrency}"  id="currency"/> 

I get  the above page content from my controller and parse the content untill i get the "currency" field so that  i can know the currency Symbol.
Code:
Pagereference p = Page.BALINK;
blob b = p.getcontent();
.
.
.
search into b.toString() the currency field.

 
I know this not elegant but i didn't find in SF such a capability for retrieving CurrencySymbol.
Koen (BvD)Koen (BvD)

thanx for your answer, but I am not sure that this will help me. I am using the webservice api, not apex code. Furthermore I can get the currency symbol of the user, that is not a problem. My problem is that I have no way to map this generally to a currency, so I am currently handling only the most trivial currency symbols €, $ and £, but I don't feel like adding a new currency to this list every once in a while It would be much better if I could get the ISO code especially as this is not a one to one mapping (a $ could mean USD, but probably plenty of other currencies as well)

I was wondering by the way how the app would behave when the account changes from currency, but I don't see any way to do this. It seems that somehow this is determined for the entire account upon account creation and that it cannot be changed later. Can someone confirm this? That would avoid me the problem of having to handle changes in currency .... On the other hand I can only test my app for one currency.

Koen.

Ritika BhargavaRitika Bhargava

Hi, 

 

I am trying to get the organization's currency symbol in both the cases (when the multi-currency feature is enabled and when it is disabled).

 

Please post the solution, if you were able to crack it.

 

Thanks in advance 

Koen (BvD)Koen (BvD)

Sorry didn't find a solution (didn't search either). However I don't think the question is relevant for multi-currency organsiations because the currency can change for each record. In that case you just have to go for the currency information on the record.

 

From the api help topic on currencies

 

"Currency fields contain currency values, such as the ExpectedRevenue field in a Campaign, and are defined as type double.

For organizations that have the multicurrency option enabled, the CurrencyIsoCode field is defined for any object that can have currency fields. The CurrencyIsoCode field and currency fields are linked in a special way. On any specific record, the CurrencyIsoCode field defines the currency of that record, and thus, the values of all currency fields on that record will be expressed in that currency."

Ritika BhargavaRitika Bhargava

I am aware that the currency symbol will differ for every user in multi-currency organsiations (based on the region), but what I am trying to do is get the manager's currency symbol irrelevant of the user logged in and then convert the user's data to manager's currency equivalent. Also, I can't use convertCurrency() as there would be too many SOQL queries.

 

Please suggest.