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
Board salesforceBoard salesforce 

Method does not exist or incorrect signature : Test.getStandardPricebookId()

Hi Techie's ,

I am in the version of 36 still it is shwoing the error message as 

Method does not exist or incorrect signature : Test.getStandardPricebookId()

Can any help out.
Best Answer chosen by Board salesforce
Board salesforceBoard salesforce
Hi All,
Below link  was the issue i cleared now .

https://developer.salesforce.com/forums/?id=906F000000090HbIAI

Thanks,
Ram

 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi,

Just see what version is your test  using.And you need to set SeeAllData to true it seems got from below links.

Please refer these links for the same.

https://developer.salesforce.com/forums/?id=906F00000005I0JIAU
 
https://developer.salesforce.com/forums/?id=906F0000000AayCIAS
 
Hope this helps you!

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
 
Thanks and Regards
Sandhya

 
Board salesforceBoard salesforce
Hi sandya,

Thanks for the try,
it is not the Answer.

Thanks ,
Ram.
parth jollyparth jolly
Hi ,

******************Reposting answer by scottbcovert********************************

I thought with Summer '14 you should be able to use the Test.getStandardPricebookId() method but if that isn't working then you could set SeeAllData to true 
 
Pricebook2 standardPbook = [select id from Pricebook2 where IsStandard = true limit 1];
Id pricebookId = standardPbook.Id;

Here are some additional resources that might prove useful:

https://developer.salesforce.com/forums/?id=906F00000008yveIAA

http://stackoverflow.com/questions/9164986/how-do-i-avoid-standard-price-not-defined-when-unit-testing-an-opportunitylineit

Thanks

 
Board salesforceBoard salesforce
Hi All,
Below link  was the issue i cleared now .

https://developer.salesforce.com/forums/?id=906F000000090HbIAI

Thanks,
Ram

 
This was selected as the best answer