Once I add Products to the Opportunity I can no longer edit the Opportunity's Amount field. Is it possible to change that amount so that it is saved on the Opportunity as a different amount? Possibly with workflow or a trigger? I tried a workflow and it looked like it didn't work.
[SalesForce] How to Change the Opportunity Amount
Related Solutions
Why does the Opportunity currency become uneditable after a line item is added? Has anyone beeen able to make the currency editable on an Opp with a line item?
This is because the Opportunity Line Item (OLI) has a lookup to the PricebookEntry object. The PricebookEntry represents a product entry (an association between a Pricebook2 and Product2) in a price book.
The PricebookEntry must have a currency value (when multiple currency is enabled). I (believe) that it is this, that is actually preventing you from changing the currency on the Opportunity as all OLI lookups to PricebookEntry must have matching Currencies. (i.e An OLI must lookup a Product, using PriceBook, all in the Same Currency as the original Opportunity.)
Currently when you try to change the Opportunity Currency, at that point in time it will no longer match the Currency of the PricebookEntry and so would fail to match the criteria.
Has anyone beeen able to make the currency editable on an Opp with a line item?
I personally haven't done it myself but in principal it is possible via Apex and a button or link. The code would need to do the following:
- Record ALL existing information about the OLI including lookups to related objects
- Find the corresponding PricebookEntry lookups for the same Product2 and Pricebook2 with the new currency
- Report an error if a match is not found (or skip that OLI)
- Delete existing OLI records
- Update the Currency of the Opportunity
- Create New OLI records with the new currency and new PricebookEntry lookup values
This all sounds a bit of overkill for what should be a simple requirement but am not aware of another solution. So careful consideration will be required before undertaking the work.
Jason
For opportunities with products, the amount is the sum of the related products. You cannot directly edit the amount unless the opportunity has no products. To change the amount for an opportunity that contains products, edit the sales price or quantity of the related products.
So you need to make sure that the amounts on the OpportunityLineItem are correct. Those you can update with workflow/apex code. But there are some limitations there as well, see https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_opportunitylineitem.htm
Best Answer
From the help: