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
Shiv ShankarShiv Shankar 

currency field changed to default organisation currency

Hi Friends,

 

I have multiple currency activate in one organisation. A user fills an amount in different currency. i am using this field, in some calculation in controller. My requirement is that before using this amount field in calculation, it should be converted in to default organisation currecy value. How can i achieve this ?

sfdcfoxsfdcfox
Currency conversion is automatic. All values that the code sees will be in the corporations default currency. If you are querying values, you can use convertCurrency() to translate the amount into the user's currency (in SOQL).
Shiv ShankarShiv Shankar

Hi sfdcfox,

 

I have multi currency activate in my ORG.

 

So when I create a new Currency field on an object, I get's two fields .

 

1. Numeric Field for entering numeric amount.

2. Picklist field to select currency.

 

Now when I make a query on this object for Currency field, it returns me amount which I have entered in the currency which I have selected.

 

But I want : when I make a query for this field it should return me amount in default currency which is set for the ORG.

 

Please help me to achieve this.

Shiv ShankarShiv Shankar

Some more clarification

 

In my scenario I am havening following condition.

 

1. Corporate Currency - or organization default currency is - USD

2. User default currency on the user Record - EUR

3. Currency Selected on record is - GBP.

 

So when I make a query for this record in apex code, I get amount in GBP.

If I use convertCurrency(Amount__c) I gets amount in EUR.

But I want to get amount in USD. How can I do this ?