function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kyle OberholtzerKyle Oberholtzer 

Flows: Record Update tried to update records: null

Hey all!
I have an issue that I can't figure out at all. 
I have a simple flow. It takes an Order record as an input, finds the related OrderItems, and loops through them to update a record on them with a currency value. 

But, when I run the flow, the Update Record node is failing. The Loop collection variable looks like it has the right collection, but the Update tries to "update records: null", which makes the Flow loop endlessly and eventuallly hit max flow depth. 

The Flow is invoked by a Process, when the status of the order changes. 

The Flow debug log is as follows: 

FAST LOOKUP: Get_NS_OrderItems
Find all OrderItem records where:
Product2Id Does not equal {!FTK_Prod2Id} (01t2M000005o9eQQAQ)
Serialized_Item__c Equals false
OrderId Equals {!Active_Order.Id} (8012M000008Po5cQAC)
Store the values of these fields in Get_NS_OrderItems: Unit_COGS__c, Product2Id, Id
Result
Successfully found records.

LOOP: NS_Loop
Loop Through: [8022M00000CUp3SQAT]
Iteration: 0
Current iteration item: 8022M00000CUp3SQAT

FAST LOOKUP: Get_NS_Asset_COGS
Find all Asset records where:
Product2Id Equals {!NS_Loop.Product2Id} (01t2M000005oOVYQA2)
Store the values of these fields in Get_NS_Asset_COGS: Unit_COGS__c, Id
Result
Successfully found records.

ASSIGNMENT: Assign_COGS_to_OrderItem
{!NS_Loop.Unit_COGS__c} Equals {!Get_NS_Asset_COGS.Unit_COGS__c}
Result
{!NS_Loop.Unit_COGS__c} = "11.48"

UPDATE RECORDS: Commit_NS_COGS
Find all OrderItem records where:
Id Equals {!NS_Loop.Id} (8022M00000CUp3SQAT)
Update the records’ field values.
Unit_COGS__c = {!NS_Loop.Unit_COGS__c} (11.48)
Result
Failed to update records that meet the filter criteria.

The error message is here: 
Error Occurred: The flow tried to update these records: null. This error occurred: CANNOT_EXECUTE_FLOW_TRIGGER: We can't save this record because the “Write COGS to Order Products” process failed

Unfortunately, I've already reached out to SF Support and they cannot help, as Flows support is not included in our current support package. 

Best Answer chosen by Kyle Oberholtzer
Kyle OberholtzerKyle Oberholtzer
Figured it out - it was flawed from the start, orderitems can't be changed while there's order changes happening.  (https://trailblazer.salesforce.com/issues_view?id=a1p3A0000001CuSQAU)

Running the flow from a URL button works as expected. 

All Answers

Kyle OberholtzerKyle Oberholtzer
Also to note, the update fails when it's instead placed outside the loop and is told to run on the loop's collection variable, with the same error. 
Kyle OberholtzerKyle Oberholtzer
Figured it out - it was flawed from the start, orderitems can't be changed while there's order changes happening.  (https://trailblazer.salesforce.com/issues_view?id=a1p3A0000001CuSQAU)

Running the flow from a URL button works as expected. 
This was selected as the best answer
Cathy PostmusCathy Postmus
Hi Kyle, thanks for the info. I have the same issue. I was hoping to completely automate it - are you thinking there is no way around it?
Kyle OberholtzerKyle Oberholtzer
Based on that issue yeah, I think the only way to make it work is the URL button. That's what we've been doing - look into how to make the URL redirect back to the Order after the Flow is done, it at least lets us press the button and return to the Order with minimal delay.