• Brian Hayes 12
  • NEWBIE
  • 15 Points
  • Member since 2019
  • Technology Director
  • John Muir Land Trust

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
With a scheduled path on a record triggered after save flow, when the scheduled path is executed, is the record reloaded from the database?

Background:
I'm having a record triggered flow invoke a sub-flow to do the work - the sub-flow accepts two inputs: the record and the record Id.  If the record is not provided and the record Id is provided, the record Id is used to get the record. I'd prefer to use the record input to avoid the Get Record execution.

I've read this: Record-Triggered Automation | Salesforce Architects (https://architect.salesforce.com/design/decision-guides/trigger-automation), specifically section Transferring Data or State Between Processes. Note that the question is specific to scheduled paths and not asynchronous paths; altough, some best practicies with respect to field values may apply to both.

Here's a specific use case/scenario.  We use the NPSP.  The Opportunity object has child Opprtunity Contact Role objects: the Opportunity Contact Role has a field named Opportunity of type Lookup (Opportunity).  After the Opportunity and Opportunity Contact Role records are saved, I want to run a flow to review the values on the Opportunity Contact Role records and depending on the values, make changes.  The flow might also change the Opportunity's  Primary Contact value. Given my understanding of the NPSP, I assuem that that NPSP first creates and saves the Opportunity record and then creates the Opportunity Contact Role records since the Opportunity record Id is saved in the Opportunity field.  I don't know if this is done within the same transaction.
I have a Apex test class to test a Salesforce flow.  When I added zero wait (resume as-soon-as-possible) pause elements, the test no longer passed.  I added the pause elements to deal with the transaction limits being encountered during bulkification.

What's a good solution to check for the flow being completed before executing the Test.stopTest() and performing assertions? 

From what I've seen, there's no method on the Flow.Interview class for checking the flow completion status or for getting the flow instance id (start() returns void).  I also see that there's a FlowInterview object that can be queried using SOQL; but, I worry about being able to idenify the unique flow instance if there are multiple instances of the flow with the same name.

Note, I did create a work around that I'm not satisfied with.  I added a NoPause boolean input to the flow and then put a decision elment before each pause where the decision element checks the value of NoPause.  In this way, the Apex test can provide the NoPause input set to true and the test passes.  Unfortunately, this does not execute the typical path through the flow.

Thanks in advance!
I have a Apex test class to test a Salesforce flow.  When I added zero wait (resume as-soon-as-possible) pause elements, the test no longer passed.  I added the pause elements to deal with the transaction limits being encountered during bulkification.

What's a good solution to check for the flow being completed before executing the Test.stopTest() and performing assertions? 

From what I've seen, there's no method on the Flow.Interview class for checking the flow completion status or for getting the flow instance id (start() returns void).  I also see that there's a FlowInterview object that can be queried using SOQL; but, I worry about being able to idenify the unique flow instance if there are multiple instances of the flow with the same name.

Note, I did create a work around that I'm not satisfied with.  I added a NoPause boolean input to the flow and then put a decision elment before each pause where the decision element checks the value of NoPause.  In this way, the Apex test can provide the NoPause input set to true and the test passes.  Unfortunately, this does not execute the typical path through the flow.

Thanks in advance!
Hi All,

Can anyone please suggest me how can we use break, continue in flow builder loop like apex. I have screen flow where I am using loop Logic. In this loop, if loop veriable contains 3 records/String values then if my condition is met in first iteration; I just want to stop my loop.

Any help regarding this would be highly appriciated.

Thanks in Advance!
Pawan 

I need to know what syntax to use to parse the street number out of the standard street address field in a trigger.  I only need up to the space in my custom field.

 

Any help would be greatly appreciated.