• Daphne Klozori
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
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!
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
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