You need to sign in to do that
Don't have an account?
arcticcloud
Opportunity Trigger, multiple currency
Hi all.
I am trying to fire a trigger when a new opportunity is created to select the account's default currency for this opportunity.
trigger currencyTransfer on Opportunity (before insert) { for(Opportunity opp : Trigger.new){ opp.CurrencyIsoCode = opp.Account.CurrencyIsoCode; } }
I guess it doesn't work to lookup the currency through the account this way - what else can I do? Any help would be greatly appreciated
Try not putting any value in Opportunity currency. Since it is child of Account, automatically it will copy Account's currency. NOT 100% sure about this. If this doesn't work, then you will have query for that Account and in the select statement you have to include the currency field. Then use it..
Unfortunately the opportunity currency is not dependant on the account currency - the default corprate currency rules this. I work as a business analyst so I am not sure how to get started on the account select statement, can anyone get me started?
Thanks in advance.
I guess this might work for you.