Skip to main content

Hey Trailblazers, 

 

Question for the collective! We have 15 Product Families in our Field Service instance and 10 different rate charges as well as 6-10 different Price books that all need to be updated with a new rate. How is everyone going about updating their multiple price books? We were advised to use Apex code, but it looks to be 750 different files from what we were advised, that would need to be created, and that doesn't make a lot of sense to us. Please advise on what you all have done to make things work for you! 

 

Thanks so much.  

 

#Salesforce Field Service

1 answer
  1. Jun 21, 3:57 AM

    @Michael McCarthy

     

    This is a data job, not a coding job. No Apex needed.  

    You're updating PricebookEntry records. Each one is just a Product plus a Price Book plus a price. Lots of records, but still just records. Data Loader handles this.

    Three steps:

    Export first. Pull every PricebookEntry with Id, Pricebook2Id, Product2Id, UnitPrice. The Id is the key column. It lets you update in place instead of making duplicates.

     

    SELECT Id, Pricebook2Id, Product2Id, UnitPrice FROM PricebookEntry

    Edit in spreadsheet. Open the export, change UnitPrice to your new rates. Sort by product family and price book, apply the right rate to each group. Your 15 families and 10 charges get sorted out here in a few minutes.

    Load back in. Run Data Loader Update (not Insert), match on Id. One job. Thousands of records updated in one pass. 

    Few things to watch:

    Test in the sandbox first. Price changes ripple into quotes, work orders, and estimates. See it work safely once, then repeat in production.

    Standard price book matters. Custom price book entries need the standard entry to exist. You're updating existing entries, so this shouldn't cause issues, but Data Loader's error file will flag any that do.

    If this repeats yearly, save your Data Loader mappings. Next year is push-button. That's the only automation you need. Still not Apex.

    Where the Apex advice came from: code only makes sense if rates must recalculate automatically based on business logic. Even then, one Flow or one trigger does it, not 750 files. For a bulk rate refresh, Data Loader is the tool. An afternoon of work, not a dev cycle. 

    -SP

0/9000