Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
ShowAll Questionssorted byDate Posted

# Want to copy currency field

Hi,

I need to copy the standard multiple currency picklist into another picklist so that I can just have the Currency Code. I was optimistic with the following formula, but there's that missing ) !!

(
IF(
OR(
ISPICKVAL(CurrencyIsoCode, "EUR - Euro"),
)
"EUR",
(
IF(
OR(
ISPICKVAL(CurrencyIsoCode, "USD - U.S. Dollar"),
)
"USD")))

Any suggestions?
Thanks much!

The following does not have syntax errors - but only returns USD as a value??

if(ispickval(CurrencyIsoCode, "EUR - Euro"), "EUR",
if(ispickval(CurrencyIsoCode, "USD - U.S.Dollar"), "USD"," USD"
)
)

Message Edited by nonprofit admin on 01-31-2008 08:10 PM
Jeff Talbot

Your 2nd formula is the right syntax. The first one is full of problems.

Currency is one of those standard Salesforce picklist fields with a bit of "extra behavior" added by Salesforce -- that being the addition of text to the actual picklist value when it's viewed in the UI. The literal picklist values for this field are simply the three letter code without the extra text (i.e. USD, EUR, CAD, GBP.... etc.).

Try writing your formula with CurrencyIsoCode, "EUR"  instead of CurrencyIsoCode, "EUR - Euro".

Thanks for your comments! The original way actually provides a value (USD), however, I must be calling for USD to be the answer in each case. I am actually trying to get eur to return eur AND usd to return usd.
Jeff Talbot
You're getting a "USD" result because you've entered "USD" for your else value. Use "n/a" for your else value and you'll see what I mean --  all your records will say "n/a" because you're using the wrong value in your ISPICKVAL expression.

You're not getting any "EUR" values (and if you sub "n/a" for your else value you won't get any "USD" values either) because you're evaluating for "EUR - Euro" and "USD - U.S.Dollar" . There are no records with those values. Even though it appears in the UI that way, behind the scenes he picklist values are "EUR" and "USD". Those are the values you need to check for in your ISPICKVAL expression.

I've copied your original formula below and made the modifications that I have suggested. Try it out.

if(ispickval(CurrencyIsoCode, "EUR"), "EUR",
if(ispickval(CurrencyIsoCode, "USD"), "USD","n/a"
)
)

Message Edited by TA_Invisible on 02-05-2008 05:04 PM