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
Daphne KlozoriDaphne Klozori 

Trigger not working

Hi ALL,

I am new to APex Triggers and was wondering whether I can get some help here.
I am trying to link two custom objects together. One object is called "cmd", the other is an automatically created copy of the OLI, called "oliExt".
I want the trigger to automatically copy the revenue from one to the other.

My problem is the currency. CMD object is always in Company Currency, i.e. CHF. oliExt object can be in any currency. the user has picked. 
I thought there is an easy way of writing the trigger, so that the oliExt revenue is always converted into CHF when auto-filled into the CMD, but don't know how...

Below is the line that I need to fix in the trigger:

"cmd.SFDC_Revenue__c = convertCurrency[oliExt.UnitPrice__c]"

Any help is much appreciated!
VikashVikash (Salesforce Developers) 
Hi ,

Please follow these links related to your query:

https://developer.salesforce.com/forums/ForumsMain?id=906F00000008omIIAQ
http://salesforce.stackexchange.com/questions/13282/updating-multi-currency-rates-from-apex

Hope these links will help you.

Thanks
Vikash_SFDC