• Steve Cox 9
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
I have some flows that are causing too many SOQL errors.

I have a flow that for any contact ID, will:
- lookup all related records (m:m) in a custom module (entitlements); 
- constuct a text field from fields from all these records;
- add this text field to the contact record and write to the database.

(the text feld is used in calling external APIs)

That works fine. However if an entitlement record is edited, then all contacts that refer to this entitlement need to have the text field re-constructed.

I created a second visual flow that for a entitlement record:
- lookups all related contacts
- for each contact, call the first flow.

Now, using the second flow, it can end up looping through a large number of contacts and call loops for each that hit the database - causing the 'to many' error.

I can't think of an easy way to rewrite these flows so I'm hoping for some suggestions. I have very limited experience with Apex development so I'm hoping I can keep the work using flows and process manager etc.

As it looks like I need to break this into different contexts, is there a way to have the first flow schedule the looped calls to the second flow - in a way similar to using @future? So that they don't all occur at once in the same context?

Thanks
Hi,

I hava a flow that - for any contact -  constructs an SObject collection of related records.

However, this collection is not sorted. I'm looping through this collection to construct a text field from the record names, but I would like to have this in alphabetical order. The only facility appears to be the 'ascending' or 'descending' option for the loop, but that appears to be for the index, not values within the objects.

Any suggestions?
I have some flows that are causing too many SOQL errors.

I have a flow that for any contact ID, will:
- lookup all related records (m:m) in a custom module (entitlements); 
- constuct a text field from fields from all these records;
- add this text field to the contact record and write to the database.

(the text feld is used in calling external APIs)

That works fine. However if an entitlement record is edited, then all contacts that refer to this entitlement need to have the text field re-constructed.

I created a second visual flow that for a entitlement record:
- lookups all related contacts
- for each contact, call the first flow.

Now, using the second flow, it can end up looping through a large number of contacts and call loops for each that hit the database - causing the 'to many' error.

I can't think of an easy way to rewrite these flows so I'm hoping for some suggestions. I have very limited experience with Apex development so I'm hoping I can keep the work using flows and process manager etc.

As it looks like I need to break this into different contexts, is there a way to have the first flow schedule the looped calls to the second flow - in a way similar to using @future? So that they don't all occur at once in the same context?

Thanks
Hi,

I hava a flow that - for any contact -  constructs an SObject collection of related records.

However, this collection is not sorted. I'm looping through this collection to construct a text field from the record names, but I would like to have this in alphabetical order. The only facility appears to be the 'ascending' or 'descending' option for the loop, but that appears to be for the index, not values within the objects.

Any suggestions?
I have a text formula to which I would like to add a carriage return/line break.  I tried concatenating chr(13) and chr(10), but the validation didn't like it.  Is this possible?