You need to sign in to do that
Don't have an account?
MC2014
Trigger body is invalid and failed recompilation?
We have serveral triggersdating back from the days before my time, many have been failing and with similar errors.
They all has always worked and still worked, in Production and the other developer sandbox, but not the full sandbox which was recently refreshed.
This is one of the failures i get when adding or editing an opportunity:
"Apex trigger UpdateOpportunityProduct caused an unexpected exception, contact your administrator: UpdateOpportunityProduct: execution of BeforeUpdate caused by: line 5, column 21: trigger body is invalid and failed recompilation: Variable does not exist: pricebookentryid"
and the code:
Already reach out to salesforce and closed my ticketet saying it's "Internal Server Error", let me know what you guys think?
They all has always worked and still worked, in Production and the other developer sandbox, but not the full sandbox which was recently refreshed.
This is one of the failures i get when adding or editing an opportunity:
"Apex trigger UpdateOpportunityProduct caused an unexpected exception, contact your administrator: UpdateOpportunityProduct: execution of BeforeUpdate caused by: line 5, column 21: trigger body is invalid and failed recompilation: Variable does not exist: pricebookentryid"
and the code:
trigger UpdateOpportunityProduct on OpportunityLineItem (before insert, before update) { Set<Id> pbeIds = new Set<Id>(); for (OpportunityLineItem oli : Trigger.new) pbeIds.add(oli.pricebookentryid); Map<Id, PricebookEntry> entries = new Map<Id, PricebookEntry>([select Product2.Product_Type__c, Product2.Product_Category__c, Product2.ProductCode, Product2.Assessment__c, Product2.PD_Complimentary_Group_Type__c from PricebookEntry where id in :pbeIds]); for (OpportunityLineItem oli: Trigger.new) { Product2 product = entries.get(oli.PricebookEntryId).Product2; oli.Product_Type__c = product.Product_Type__c; } }
Already reach out to salesforce and closed my ticketet saying it's "Internal Server Error", let me know what you guys think?
All Answers
Do you think it's that their salesforce platform is screwed up after I refresh the sandbox around 6/16? that is when I notice this started happening.
Ta
Vish
The errors messages I get from my full sandbox and my deverloper and box are completely different. Shoudn't they have similar error messages since they pretty much contain the same apex class and triggers as production.
So I am looking at "https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_opportunitylineitem.htm" and it says "Exists only for those organizations that have Products enabled as a feature." so, how do I check to see if it's enabled?