Ask Search:
sales leadssales leads 

Validation Rule Causing FlowApplication Errors

Hi,
I have set up 4 checkbox fields in "Opportunity" Object. When someone sells an itinerary and marks the stage as "Closed Won", it is required that they select one of the checkboxes to successfully save the opportunity as "Closed Won"
The rule looks like:

"a validation rule:
AND( 
ispickval(StageName,'Closed Won'), 
Payment_due_45_days__c = FALSE, 
Payment_due_60_days__c = FALSE, 
Payment_due_90_days__c = FALSE, 
Payment_due_120_days__c = FALSE 

)

Once this rule was active, we started noticing FlowApplication Errors looking like:
Subject: 
Error Occurred During Flow "Auto_Populate_Account_Name": The flow tried to update these records: null. Thi..
Error element myRule_1_A2 (FlowRecordUpdate).
The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Check the box for a Payment Due Date reminder. You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYkOwAAL. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYkRHAA1. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYkXFAA1. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Check the box for a Payment Due Date reminder. You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYkqlAAD. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYGXLAA5. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LWc4BAAT. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LWcZ9AAL. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flowtried to update these records: 0064100000LWcdfAAD. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LWb66AAD. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LXt71AAD. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LWdPFAA1. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000Kk0LzAAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Check the box for a Payment Due Date reminder. You can look up ExceptionCode values in the SOAP API Developer Guide.


Questions:
1. Is my Validation Rule correct?
2. This error is related to a process builder "Auto Populate Account Name", which is based off a different object. This process builder is set up to auto populate account and opportunity name with leads first and last name on lead convert. how is this process builder and validation rule related?
3. why is this error occuring?
4. the record ids i get in the flowapplication emails are either "planning" or "lost".. whicle the validation rule is on "closed won".. so why are these records causing error?
5. what is this error possibly doing? is it failing a lead convert or a record update?

Any help will be highly appreciated. TYIA

 

Best Answer chosen by sales leads
Narender SinghNarender Singh
Try this:

AND( 
ISCHANGED(StageName),
 ispickval(StageName,'Closed Won'), 
Payment_due_45_days__c = FALSE, 
Payment_due_60_days__c = FALSE, 
Payment_due_90_days__c = FALSE, 
Payment_due_120_days__c = FALSE 

)

All Answers

Nick SauerNick Sauer
Add ISCHANGED(Status) to your validation rule and should be ok.  This will make it only fire if you’re changing that status field.  I’m assuming it’s trying to update closed records (or trying to) and throwing the error.  
Nick SauerNick Sauer
Sorry ISCHANGED(StageName). 
Narender SinghNarender Singh
Hi,
Your validation rule is correct.

The reason you are getting this error is because among the list of opportunities that are created by the process builder, Few of them are not passing the validation rule and thats why all the insertions all getting roled back. 
What is interesting to note here is the records which are causing the validation exception, all of them have NULL as their IDs which points to the face that they aren't created yet.
Narender SinghNarender Singh
Try this:

AND( 
ISCHANGED(StageName),
 ispickval(StageName,'Closed Won'), 
Payment_due_45_days__c = FALSE, 
Payment_due_60_days__c = FALSE, 
Payment_due_90_days__c = FALSE, 
Payment_due_120_days__c = FALSE 

)
This was selected as the best answer
sales leadssales leads
@narender:

I added ISCHANGED(StageName), to the validation rule and it seems to be working for now. are you sure this should resolve the error?

was the old validation rule trying to update all other itineraries too. leading to an error?
 
Narender SinghNarender Singh
I can be 100% sure only when I see what you are doing in your process.
But yeah, what we can conclude from this is  it’s either trying to update closed records or trying to close them(setting stage as closed won).
sales leadssales leads
The process builder looks like this @narender:

User-added imageUser-added image
Narender SinghNarender Singh
Share the part where you are updating opportunities
sales leadssales leads
User-added image
sales leadssales leads
this is simply updating opportunity/itinerary name with leads first and last name on lead convert..
sales leadssales leads
@narender, now that the error has been fixed, i want to know if the records involved in the error might have been affected in any anyway?
here is the full error:

Error element myRule_1_A2 (FlowRecordUpdate).
The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Check the box for a Payment Due Date reminder. You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYkOwAAL. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYkRHAA1. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYkXFAA1. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Check the box for a Payment Due Date reminder. You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYkqlAAD. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LYGXLAA5. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LWc4BAAT. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LWcZ9AAL. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flowtried to update these records: 0064100000LWcdfAAD. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LWb66AAD. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LXt71AAD. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000LWdPFAA1. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: 0064100000Kk0LzAAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . You can look up ExceptionCode values in the SOAP API Developer Guide.---The flow tried to update these records: null. This error occurred: FIELD_CUSTOM_VALIDATION_EXCEPTION: Check the box for a Payment Due Date reminder. You can look up ExceptionCode values in the SOAP API Developer Guide.

Flow Details
Flow Name: Auto_Populate_Account_Name
Type: Record Change Process
Version: 2
Status: Active
Org: SouthAmerica.travel (00D41000002jFTq)

Flow Interview Details
Interview Label: Auto_Populate_Account_Name-2_InterviewLabel
Current User: Sales Leads (005410000028VTJ)
Start time: 6/12/2018 3:50 PM
Duration: 2 seconds

How the Interview Started
Sales Leads (005410000028VTJ) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = 00Q4100000YQklpEAD
myVariable_current = 00Q4100000YQklpEAD

ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!$Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "6/12/2018 3:50 PM"

DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!myVariable_current.IsConverted} (true) Equals true
Logic: All conditions must be true (AND)

RECORD UPDATE: myRule_1_A1
Find all Account records where:
Id Equals {!myVariable_current.ConvertedAccountId} (0014100001FDxUmAAL)
Update the records’ field values.
Name = {!formula_3_myRule_1_A1_8029717524} (Steffany Loeb)
Result
All records that meet the filter criteria are ready to be updated when the next Screen or Wait element is executed or when the interview finishes.

RECORD UPDATE: myRule_1_A2
Find all Opportunity records where:
Id Equals {!myVariable_current.ConvertedOpportunityId} (0064100000K82SPAAZ)
Update the records’ field values.
Name = {!formula_2_myRule_1_A2_2029243597} (Steffany Loeb)
Result
Failed to update records that meet the filter criteria.
sales leadssales leads
@narender and @nick:

Adding ISCHANGED(StageName) to the rule have not led to any error so far but i have noticed one major probem with this:

I am having the opp set to closed won with one checkbox checked
but when i uncheck the same checkbox and save, - VR will not fire, but it should!
any comments about that?
Nick SauerNick Sauer
You aren’t changing the status in that example so it wouldn’t fire.  If users are supposed to be going in and changing terms after Closed Won status you’d need to account for this in another way...you could add the ischanged() check on the checkbox fields instead for example.
sales leadssales leads
@nick, if i add the ischanged() check on the checkbox fields instead, how can i do it according to my requirement: that atleast 1 checkbox has to be checked for the stage to be closed won?