Notify user if a product they're quoting is added to opportunity - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Adam McCombieAdam McCombie 

Notify user if a product they're quoting is added to opportunity

All of our products are unique, and I'm wanting to add a proccess flow that sends an email alert to a salesrep letting them know when a product they've added to an opportunity has been added to someone else's opportunity.
Best Answer chosen by Adam McCombie
Ankush AgarwalAnkush Agarwal
Hi Adam,

You may use Process Builder and Automated flow as below:

Create an automated process flow
Create a variable data type as Text named as InputOppId and select available as Input
Create a variable data type as Text named as InputProductId and select available as Input
Add Get Records from elements section in left side and update details like below:
Object as Opportunity Line Item
Add below Criteria
Opportunity ID != InputOppId
Porduct2Id = InputProductId
Store values in a new record type variable(OppRecord) and select checkbox if record is not available make value as NULL
Drag and Drop Decision Box and validate if OppRecord is not NULL
Add Email Action to send an email to Opportunity Owner
Save the Flow and Activate it


    Create Process Builder on Opportunity Line Item object
    Select Opportunity Line Item as object
    Start the process when when a record is created or edited
        Add Criteria
        Criteria Name
        Set Conditions <---- this may be based on your requirement
    Add Action
        Action Type as flow
        Action Name
        Select Newly created Flow
        Set Field values 
InputOppId = OpportunityId
InputProductId = Product2Id
    Save and activate the Process Builder

Hope this will help
 

All Answers

Ankush AgarwalAnkush Agarwal
Hi Adam,

You may use Process Builder and Automated flow as below:

Create an automated process flow
Create a variable data type as Text named as InputOppId and select available as Input
Create a variable data type as Text named as InputProductId and select available as Input
Add Get Records from elements section in left side and update details like below:
Object as Opportunity Line Item
Add below Criteria
Opportunity ID != InputOppId
Porduct2Id = InputProductId
Store values in a new record type variable(OppRecord) and select checkbox if record is not available make value as NULL
Drag and Drop Decision Box and validate if OppRecord is not NULL
Add Email Action to send an email to Opportunity Owner
Save the Flow and Activate it


    Create Process Builder on Opportunity Line Item object
    Select Opportunity Line Item as object
    Start the process when when a record is created or edited
        Add Criteria
        Criteria Name
        Set Conditions <---- this may be based on your requirement
    Add Action
        Action Type as flow
        Action Name
        Select Newly created Flow
        Set Field values 
InputOppId = OpportunityId
InputProductId = Product2Id
    Save and activate the Process Builder

Hope this will help
 
This was selected as the best answer
Adam McCombieAdam McCombie
Thanks Ankush, 

This all seems to make sense, but I'm getting caught up here "Store values in a new record type variable(OppRecord) and select checkbox if record is not available make value as NULL"

I'm not sure where you mean I'm supposed to create OppRecord and what type of variable it should be. In record collection when I create a variable called OppRecord it doesn't allow me to insert it there. Maybe I'm missing something (I'm also on professional edition so there may be things I don't have access to)
User-added image
Ankush AgarwalAnkush Agarwal
Hi Adam,

You need to create a new resource with below details and use it in red highlighted box in your screenshot:

User-added image

Store values in a new record type variable(OppRecordList) and select checkbox if record is not available make value as NULL
Drag and Drop Decision Box and validate if OppRecordList is not NULL
Drag and Drop Loop Box and use OppRecordList as Loop input
Add Email Action to send an email to Opportunity Owner for each record
Save the Flow and Activate it
Ankush AgarwalAnkush Agarwal
1 more point, Change below (Conditions are met) to get other opportunities which are already have product:

OpportunityId    Does not Equal       InputOppId
 
Adam McCombieAdam McCombie
thanks Ankush, I think I understand now, I'll try this out.