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
PoopermanPooperman 

State Unchanged

Flow saves it's state such that when you hit previous, everything is as it was. However, if you hit next again, even after changing the information, nothing changed (this includes DML ops). There's a solution to this by putting the Create DML into a subflow (with other logic). There is one place I have not found a workaround. Here is my scenario:

 

I have a lookup to account that uses a SSN to search for the account.Id. It's fine the first time; but if you hit previous, change the SSN to be searched, then hit forward again, it will not change anything. The next screens are in their own subflow, and the SSN search is in it's own subflow. I added a "reset" button to the search screen (Javascript + checkbox) in the hopes that going out in the forwards direction and back into the subflow (resetting all the values) would cause the subsequent "next" into the subflow to redo the search.

 

Here's what happens:

 

I put in a SSN that i know belongs to Joe Schmoe, search it sucessfully. But I typed it wrong, and instead wanted to find Jane Doe so I hit previous, hit reset. The thing is fresh and I type Jane Doe's SSN correctly, but when I hit next, Joe Schmoe's information is still there (separate subflow like I said before).

 

If any of you have a solution, please reply. If there is nothing I can do, please let me know that as well. Thanks!

RajaramRajaram
Yes.. when you go back and forth in a flow, you are essentially pushing and poping the flow state from a stack. However, DML operations are atomic and that operation once committed cannot be automatically rolledback.

A good way to prevent duplicate records being created is to put the record creation in a subflow which first checks if the record has already been created and create only if needed.
PoopermanPooperman

I realize this and have these measures in place to prevent dupes already. The issue comes when a user makes a search for something from the flow but makes a mistake. How do you allow them to search again without having to reload the whole flow? It would be great if you could hit previous, change it, hit next and it would load the subflow correctly with the new information. The only DML in this case is a lookup to Account.

 

EDIT: If it can't be done, let me know. If that is the case, that's ok as well (a bit of a bummer, but ok none the less).