FavoriteGorav Seth (Ashoka) (Originally posted by Rick Haag)Aug 18, 2017, 3:59 PMLooping and Fast Updates.pngRick HaagLoops, Fast Updates and CPU Timeouts I have done a bit of research to find if there is some way to mass update records in an Sobject Collection Variable "without" Looping through each recordAssigning a value to an Sobject VariableAdding to a final collection and finally using the Fast Update element to write the new value. Is it possible to simply run a Fast Lookup to build the collection and then update a single column in the collection, with the same value for every record, then Fast Update? Example:Fast Lookup (Opportunity: ID & CustomCheckbox__c).After the fast lookup, update resulting collection to where "Custom Checkbox" in all records of the collection is set to TRUE.Fast Update Is there some way to do this without looping through each record in the collection? I have looked in to Collection Variables, using 1 assignment to set values in an Sobject Collection Variable, but that isn't an option (or I haven't been able to make it work). Why not just run the loop option, you may ask?It seems for collections somewhere between 600 & 700 records, looping through records triggers a Limit Warning or CPU Timeout, and thus the flow fails.Show More2 commentsLoad more comments...Gorav Seth (Ashoka)Aug 18, 2017, 3:59 PMhttps://success.salesforce.com/0D53A00003DKPimAdd a commentWrite a comment...BoldItalicUnderlineStrikethroughBulleted ListNumbered ListAdd linkCode blockInsert imageAttach filesLink URLCancelSave0/9000Reply
Rick HaagLoops, Fast Updates and CPU Timeouts I have done a bit of research to find if there is some way to mass update records in an Sobject Collection Variable "without" Looping through each recordAssigning a value to an Sobject VariableAdding to a final collection and finally using the Fast Update element to write the new value. Is it possible to simply run a Fast Lookup to build the collection and then update a single column in the collection, with the same value for every record, then Fast Update? Example:Fast Lookup (Opportunity: ID & CustomCheckbox__c).After the fast lookup, update resulting collection to where "Custom Checkbox" in all records of the collection is set to TRUE.Fast Update Is there some way to do this without looping through each record in the collection? I have looked in to Collection Variables, using 1 assignment to set values in an Sobject Collection Variable, but that isn't an option (or I haven't been able to make it work). Why not just run the loop option, you may ask?It seems for collections somewhere between 600 & 700 records, looping through records triggers a Limit Warning or CPU Timeout, and thus the flow fails.Show More