+ Start a Discussion
Anindya Halder 6Anindya Halder 6 

Is there any way to get what currency a currency field is using from DescribeFieldResult

I want to know whether a currency field value is in USD using DescribeFieldResult?

Something like Schema.DescribeFieldResult.getType() == Schema.DisplayType.CURRENCY
{
    //this value is in USD ?
}

is there any way to do this ?
bob_buzzardbob_buzzard
Describe field result gives you the schema information for a currency field. However, a the currency that the field is denominated in is specific to an individual record and stored in the CurrencyIsoCode field, so you can't assume from the schema what the denomination will be, instead you have to consider specific records individually.

There's more information at:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/field_types.htm#i1435541