27 thoughts on “Automatically Assign Pricebook Based on Opportunity Record Type

    1. Here you go:

      IF({!$Record.RecordType.DeveloperName}=’Manufacturing’, {!Get_Manufacturing_Pricebook.Id},
      IF({!$Record.RecordType.DeveloperName}=’Retail’,{!Get_Retail_Pricebook.Id},
      {!$Record.Pricebook2Id}
      ))

  1. Your guide has 2 mistakes – retail “is null” or “equals” / also the copy + paste formula does not work and leaves me with a syntax error.

  2. i dont what i am doing wrong in this scenerio followed staps as mentioned but having trouble , the error apears when i create a record : We can’t save this record because the “Auto assign pricebook based on opportunity record type” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to update records: INVALID_CROSS_REFERENCE_KEY: invalid cross reference id. You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 400282071-25548 (841704332)

  3. Hi Rakesh,
    Is it possible to refer the pricebook name rather than ID? We update pricebooks pretty regularly and all of them have currency code in their names. I want to update the pricebook based on the quote currency using name instead of ID.
    Thanks
    Pratima

    1. Yes, it is possible to use Pricebook name rather than ID.

      –> First create a custom Label to store Pricebook Name
      –> Now move your logic from Process Builder to Visual Workflow, I mean use Record Lookup element to find Pricebook ID based on Pricebook Name
      –> At th end, use Record Update element to assign Pricebook to opportunity record.

  4. Rakesh, I’ve followed your outline above to automatically add a Price Book to an Opportunity based upon the Opportunity Record Type – it works like a charm – thank you! I want to go a step further and also create a new (Opportunity) Product record based upon the Price Book that has been assigned; however, my process errors out. First, is this even possible within the same Process? Here’s a breakdown of what I’ve done:
    – Followed your outline to add a Price Book to the Opportunity (this works great by itself)
    – Created a second immediate action “Create a Record” for Record of “Opportunity Product”
    – My Object Variables are:
    — Opportunity ID / Reference / Opportunity.ID
    — Quantity / Number / 1
    — Sales Price / Currency / 0.00
    — Type / Picklist / New Business
    — Price Book Entry ID / ID / “18 Digit Price Book Entry ID”
    Any ideas of how to make this work?

      1. Thank you! This looks like what I have tried – I would double check my Price Book Entry ID to make sure that is correct. Thanks!

  5. Yes sorry, In my sandbox i’m still on version 33 and it only shows the Field and Value in the “set object veriable” , it looks like summer 15 added “type” in the variables section.

  6. Rakesh, I’m Learning so much with your process builder series of post! Thanks so much. I’m running into an issue though. I’d like to create a Price book entry in the standard price book when a product is created. I’d also like to update the standard price on that entry when a field I have called “GSA Price” is changed. It seemed like it would be an easy task but I keep getting “The record couldn’t be saved because it failed to trigger a flow” Error. Any chance you could help? Thanks, Chris

          1. I will try this shortly. How do I get the type field to show in my process? I don’t have that field and it would be a great help if I did.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.