+ Start a Discussion

Upsert PricebookEntry

I'm trying to upsert pricebookentry via apex class. I know upsert operation need an external id but I found that we couldn't create one in PricebookEntry object, so how we can tackle this problem. Does anyone had faced any similar issues before? please help me.



Many Thanks,



I think you must insert standard pricebookentry first, before inserting the custom pricebookentry . Let me know if it helps you or not , I can help you on this.


Hi hemantgarg,


I'm actually facing kind of the same problem. I'm updating many Products (setting them as Active with a scheduled method), and I want to add them to the standard pricebook at the sime time, but Salesforce System Log shows me an error saying PricebookEntry fields are not writable (?).


What are you saying when you mention "inserting the custom pricebookentry" ?


Any help will be appreciated.