Ask Search:
Brad CurrierBrad Currier 

Flow Fast Lookup and Fast Update causing an error

I am having a problem where I have a Fast Lookup that is looking at the SUbscription object and pulling the following fields:

ID
InvoiceDate
StartDate
Contract
ProductCode

It then goes through a Loop that has a decision on if the Product Code is X do this if not do that.

Then we end the lookup and go into a Fast Update.  Here I am getting an error message stating the following:

Error element Update_Subscriptions (FlowRecordUpdate).
The flow tried to update these records: null. This error occurred: INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: ProductCode__c. Please check the security settings of this field and verify that it is read/write for your profile or permission set.. You can look up ExceptionCode values in the SOAP API Developer Guide.
If I remove the FastLookup from looking up the ProductCode field then it cannot be used in my decision element.  But if I leave it in I am getting the above error.  The ProductCode field is a formula field. 

Screenshots:

Flow with FastLookup and FastCreate causing error
Screenshot of the FastLookup
Screenshot of the DecisionScreenshot of the FastCreate

Best Answer chosen by Brad Currier
Brad CurrierBrad Currier
I figured out my Problem.  It was a setting that I had unchecked under Process Automation Settings. 
 
When creating or updating records, the flow can use sObject variables to define the field values. If the running user doesn't have edit access to those fields, by default the flow fails to create or update the records. This setting filters the inaccessible fields from the request for Fast Create and Fast Update elements.

Filter inaccessible fields from flow requests

Once I checked this box it now ignores field updates to read only fields when doing a Fast Create / Fast Update.  So I can bring in a formula field in my collection use it for a decision and then update records without causing a problem.

All Answers

Pattie HeintzPattie Heintz

I feel like your update is out of order there.  Have you tried putting your "Fast Update" for your subscription before you swing back to your loop?  (finishing the entire transaction one record at a time, for example.)  I think you keep overwriting your Loop Variable each iteration.  Adding your loop variable to a new collection doesn't create a new SObject, it just adds another reference to the existing one.

I could be totally wrong here, just throwing it out there.

Brad CurrierBrad Currier
I am not sure.  I was using the following article https://help.salesforce.com/articleView?id=vpm_designer_example_loop.htm&type=5 as an example because it does a decision in a loop as a guide and they have the fast update out of the loop also.
Brad CurrierBrad Currier
I figured out my Problem.  It was a setting that I had unchecked under Process Automation Settings. 
 
When creating or updating records, the flow can use sObject variables to define the field values. If the running user doesn't have edit access to those fields, by default the flow fails to create or update the records. This setting filters the inaccessible fields from the request for Fast Create and Fast Update elements.

Filter inaccessible fields from flow requests

Once I checked this box it now ignores field updates to read only fields when doing a Fast Create / Fast Update.  So I can bring in a formula field in my collection use it for a decision and then update records without causing a problem.
This was selected as the best answer
Pattie HeintzPattie Heintz
Nicely done!
Brad CurrierBrad Currier
The new collection element is to take the two different changes and put them back into one collection. From everything that I am reading that is needed since I split them out with my decision element.