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
webuser.ax1109webuser.ax1109 

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,

Joe

hemantgarghemantgarg

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.

magandrezmagandrez

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.

 

Thanks.

 

MGA