Created
September 5, 2017 16:53
-
-
Save eddywebs/3fded178c19a17faaba03821ce6d6ea4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true ); | |
insert pb; | |
Product2 prod = new Product2(Name = 'SLA: Bronze', IsActive = true); | |
insert prod; | |
// First insert a price for the standard price book | |
Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true]; | |
PricebookEntry standardPBE = new PricebookEntry(Pricebook2Id = standardPB.Id, Product2Id = prod.Id, UnitPrice = 1000, IsActive = true); | |
insert standardPBE; | |
PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 1000, IsActive = true); | |
insert pbe; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment