You need to sign in to do that
Don't have an account?
maddy27
Method does not exist or incorrect signature: void getStandardPricebookId() from the type Test
//Create Quote Line Records
Product2 p = new product2(name='unittest');
p.Family = 'Media';
p.IsActive = true;
insert p;
system.debug('++ Prod'+ p);
// Id pricebookId = Test.getStandardPricebookId();
Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true,Effective_From__c = date.today() , Effective_To__c= date.today()+60);
insert pb;
// First insert a price for the standard price book
PricebookEntry standardPrice = new PricebookEntry(
Pricebook2Id = pb.id, Product2Id = p.Id,
UnitPrice = 10000, IsActive = true,UseStandardPrice = false, Id = Test.getStandardPricebookId());
insert standardPrice;
system.debug('standardPrice' + standardPrice);
Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];
PricebookEntry standardPBE = new PricebookEntry(Pricebook2Id = standardPB.Id, Product2Id = p.Id, UnitPrice = 1000, IsActive = true);
insert standardPBE;
PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = p.Id, UnitPrice = 1000, IsActive = true);
insert pbe;
system.debug('pbe' + pbe);
Product2 p = new product2(name='unittest');
p.Family = 'Media';
p.IsActive = true;
insert p;
system.debug('++ Prod'+ p);
// Id pricebookId = Test.getStandardPricebookId();
Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true,Effective_From__c = date.today() , Effective_To__c= date.today()+60);
insert pb;
// First insert a price for the standard price book
PricebookEntry standardPrice = new PricebookEntry(
Pricebook2Id = pb.id, Product2Id = p.Id,
UnitPrice = 10000, IsActive = true,UseStandardPrice = false, Id = Test.getStandardPricebookId());
insert standardPrice;
system.debug('standardPrice' + standardPrice);
Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];
PricebookEntry standardPBE = new PricebookEntry(Pricebook2Id = standardPB.Id, Product2Id = p.Id, UnitPrice = 1000, IsActive = true);
insert standardPBE;
PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = p.Id, UnitPrice = 1000, IsActive = true);
insert pbe;
system.debug('pbe' + pbe);
Looks like you might have an apex class with the name "Test" .. that is causing issue
All Answers
Looks like you might have an apex class with the name "Test" .. that is causing issue