Automatically Assign Pricebook Based on Opportunity Record Type using Flow #inSalesforce

Automatically Assign Pricebook Based on Opportunity Record Type using Flow #inSalesforce


Create two Opportunity Record Types - Sample1 and Sample2 (Before that create the Sales Process - Select the process as per need). Make sure the Record(s) are active


Create the Price Book(s)

AppLauncher | PriceBooks | New - Name it may be Sample1Pricebook (similarly, Sample2 Pricebook), Active - Checked | Save


Create a record-triggered flow 

object - Opportunity, On Create or Update, Fast Field Updates


Decision Element:

sample1:

record.OpportunityId isnull true

record.recordtypeId isnull false

record. recordtypeId.RecordTypeName equals Sample1

sample2:

record.OpportunityId isnull true

record.recordtypeId isnull false

record. recordtypeId.RecordTypeName equals Sample2


Get Records Element: Getsample1Pricebook

Object: Pricebook

criteria: Name equals Sample1Pricebook

only first record


Get Records Element: Getsample2Pricebook

Object: Pricebook

criteria: Name equals Sample2Pricebook

only first record


Create New Resource:

pricebookFormula

 IF({!$Record.RecordType.DeveloperName}='Sample2', {!Getsample2Pricebook.Id},

IF({!$Record.RecordType.DeveloperName}='Sample1',{!Getsample1Pricebook.Id},

{!$Record.Pricebook2Id}

))


Assignment Element:

Set price book

record.pricebookId equals pricebookFormula












Comments