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
miteshsuramiteshsura 

How do I rename a standard price book in Enterprise edition??

I can reaname all, but Standard price book. Currently the name is German, and I want to reanme it to english. 

Is there a reason why SF won't allow to reanme it? What options do I have? 

 

One way would be clone and give the English name to it, but I am not sure how SF would treat the new pricebook, as I cannot even delete German pricebook. I do not see any special setting which tells SF that this is my standard pricebook, how does it know? 

 

Thanks in advance for the time. 

 

Mitesh

sfdcfoxsfdcfox

The "Standard Pricebook" is the system default pricebook. It can't be deleted. You can deactivate it, though. I don't think it can be explicitly renamed. There is an API-only flag IsStandardPricebook (or some such), that the system uses to identify the standard price book. If I recall, it's name is set when the organization is first created (in the chosen language), and can't thereafter be renamed. You can deactivate it and clone it. It won't affect existing records; it simply prevents its use on further opportunities. If you're actually concerned about it, you can data load the old values out, modify them to the new pricebook, and then update all the records.

SFDC HedgehogSFDC Hedgehog
HI sfdcfox

If we deactivate the standard pricebook, what would be the best pattern for apex test classes that use Test.getStandardPricebookId()  ?

Further, IDK how we'd write tests involving pricebooks without having to know  the specific name (or part of it) for a pricebook  - like this;
 
Pricebook2  standardPb = [select id, name, isActive from Pricebook2 where IsStandard = true limit 1];
The only alternative seems to be the seealldata=true option....

Any ideas?

Thanks