+ Start a Discussion
selva Aselva A 

Process Buillder Issue - OpportunityLineItem

Hi Everyone,
 I am facing an issue in Process Builder. I have created a Process builder flow that assign pricebook automatically based on Zipcode's. It is working fine.

But when add products to the pricebook for an opportunity it throws an error stating that "A flow trigger failed to execute the flow with version ID...." 
I can understand the issue something as it because of "OpportunityLineItem". I couldn't able to define OpportunityLineItem to get pricebook Id.
Since my process builder based on only "Opportunity".
 
Is this issue only because of OpportunityLineItem or some other thing causing the issue?
 
Any help on this, much appreciated.
 
Thanks,
Selva
 
kryzkryz
First thing we need to know is what does the error message say? You will usually receive an email from Salesforce regarding the error message when a flow / process builder fails to execute the process. That's where we can start to troubleshoot the issue.
selva Aselva A
Hi,

I have received the following error :

An error occurred at element myRule_1_A1 (FlowRecordUpdate).
UPDATE --- UPDATE FAILED --- ERRORS : (FIELD_INTEGRITY_EXCEPTION) field integrity exception: Pricebook2Id (cannot change pricebook on opportunity with line items), 
________________________________________
This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: Pricebook_Selection
Type: Workflow
Version: 1
Status: Active
Flow Interview Details
Interview Label: 
Current User: Selva1 (005400000049w06)
Start time: 4/19/2016 11:33 AM
Duration: 0 seconds
How the Interview Started
Selva1 (005400000049w06) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = 0063300000imAnWAAU
myVariable_current = 0063300000imAnWAAU
ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "4/19/2016 11:33 AM"
DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!myVariable_current.Account.PriceBook__c} (01s40000000NMOCAA4) Is null false
Logic: All conditions must be true (AND)
RECORD UPDATE: myRule_1_A1
Find all Opportunity records where:
Id Equals {!myVariable_current.Id} (0063300000imAnWAAU)
Update the records’ field values.
Pricebook2Id = {!myVariable_current.Account.Zip_Code__r.PriceBook_Name_New__c} (01s40000000NMOCAA4)
Result
Failed to update records that meet the filter criteria.
________________________________________
Error Occurred: UPDATE --- UPDATE FAILED --- ERRORS : (FIELD_INTEGRITY_EXCEPTION) field integrity exception: Pricebook2Id (cannot change pricebook on opportunity with line items), 
________________________________________

Process flow screenshot attached,for the referenceUser-added imageUser-added image