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 

Issue in Apex Trigger - Copying revenue (different Currencies)

Hi ALL,

Recently we hired an external company to make certain modifications in our SFDC enterprise edition. The goal was the following:

Link a specific Opportunity Line Item (OLI) to a custom object and have the Unit Price copied from the OLI into the custom object. They built an Apex Trigger to do this.

ALL of our custom objects are in CHF revenue (our Company Currency), whereas the Opportunities & OLI can have their revenue displayed in all kinds of Currencies.

My issue is that I would like to have the revenue copied, which is always displayed in the Company Currency and in brackets (see screen shot attached). But I am unable to find the unique Field/API Name in order to revise the Apex Trigger. Currently, it gives me the List Price, in this case 3,400,000.00 instead of 3,154,635.60.

Screen shot of Opportunity Line Item - Unit Price field

Any Idea what the API Name is of the revenue in brackets in the OLI?

Thanks and kind regards,
Daphne
NishBNishB
Hi,
     I suppose you want to know the name of the currency in the brackets i.e CHF ,CHF = Swiss Franc. You can go to Manage Currenies under Setup to view the excahnge rates.
Daphne KlozoriDaphne Klozori

Hi Nish,

No, I do not wnat to know the Currency. I know the Company Currency. It is CHF. I need to know the unique name of this revenue field in brakcets, so that I can link this to my custom object.

Thanks!

Daphne

NishBNishB
Oh ok, its CurrencyIsoCode 
Daphne KlozoriDaphne Klozori
Hi Nish,
Unfortunately the above is not working. Since I have a custom object, I though that I need to add the custom object name in front. But no matter how I try to change it, it does not work. :-(
Thanks!
NishBNishB
From what I've understood since the OLI can be in any currency and the custom object is in CHF currency I believe you need to convert the OLI currency to CHF to get the amount displayed in CHF .So is the currency being converted to CHF in the trigger?
Daphne KlozoriDaphne Klozori

No, the trigger is not converting the currency in the Opportunity and OLI to CHF. And I suppose I cannot just link the custom object to the revenue displayed in brackets on the OLI... So, I will need to break the link between these two fields. :-(  
Thanks for clarifying!