Skip to content

Conversation

@mbiondis
Copy link
Contributor

Users may use a Quick Action on a record page that calls a screen flow that performs tasks that don't require user intervention (e.g. edit fields or create related records). Without these components, the user has to close the modal (by clicking next, or with the X) and refresh the browser to see the update.

  • The "Navigate to Next" screen component automatically "finishes" the flow and closes the modal.
  • The "Refresh View" updates the current view without reloading the browser window.

You can get details of the use case and reference material in the readme file of each component.
Below is an example of how to combine the two with the Show Toast in a screen flow.

FlowActions_Example

@alexed1
Copy link
Collaborator

alexed1 commented Jun 2, 2022

Thanks so much for this contribution, Martin. You've identified a gap and come up with a solution. Really appreciate this.

There will be questions about how your Navigate to Next is different from https://unofficialsf.com/navigate-everywhere-flow-action/...what's your take on that? Could we combine the two into a single navigate solution?

And I'm wondering how the refreshView compares to the update stuff at https://github.com/forcedotcom/LightningFlowComponents/tree/master/flow_local_actions/UpdateScreen. Should we retire the old component? merge it with your new one?

@alexed1
Copy link
Collaborator

alexed1 commented Jun 30, 2022

Hi, Martin. Any thoughts on the above?

@mbiondis
Copy link
Contributor Author

mbiondis commented Jun 30, 2022

Hi Alex!

Sorry about the late response, it's been a crazy quarter!

With regards to the Navigate Everywhere, I agree that it should be modified to implement 'Next' and 'Previous' actions (the Quick Choice component already uses this).

In terms of the Refresh View, I think this solution is better than Update Screen because it refreshes all components in the Lightning Record Page. I took inspiration from Texei's post

@alexed1
Copy link
Collaborator

alexed1 commented Jul 1, 2022

@ericrsmith35 @adwhite75 interested in your thoughts on how to position this useful new functionality from Martin.

let me try one out:
Navigate Everywhere is a navigation action that you can add to screen flows to direct the screen flow to a wide range of destinations. Your browser will load the appropriate URL when the flow reaches this action.

NavigateToNext is a screen component that triggers a Next navigation as soon as it loads. If you put this component on a screen and put that screen at the end of your screen flow it will have the effect of closing the flow, instead of leaving the user with the Your Flow Finished screen.

Update Screen is a local action that calls the Salesforce recordData component when it loads, which causes a refresh of that record.

Refresh View is a local action that calls the Salesforce refreshView component. This also causes a refresh. Martin asserts that Update Screen doesn't refresh all of the components. Should we retire Update Screen in favor of Refresh View? I'm happy to do so if it makes sense...

@ericrsmith35
Copy link
Collaborator

ericrsmith35 commented Jul 1, 2022 via email

@ericrsmith35
Copy link
Collaborator

It doesn't look like these components follow standard aura component naming conventions. Is that an issue?

@ericrsmith35
Copy link
Collaborator

I can't test the navigateToNext component because it is not exposed to flow.

@ericrsmith35
Copy link
Collaborator

ericrsmith35 commented Jul 4, 2022

I was able to get the component installed by renaming the .js and .xml code pieces. The navigateToNext failes when added to a screen that is the last element in the flow.
image

It needs to check first to see what actions are supported before determining which one to issue.

@ericrsmith35
Copy link
Collaborator

Changing the action to FINISH and testing on my Datatable Configuration Wizard flow, which runs in a modal, the component just causes my flow to restart. It does not close the modal.

@alexed1
Copy link
Collaborator

alexed1 commented Jul 16, 2022

@mbiondis , what are your thoughts on @ericrsmith35 's findings?

@alexed1
Copy link
Collaborator

alexed1 commented Sep 6, 2022

Hi, @mbiondis, checking in on this....

@mbiondis
Copy link
Contributor Author

Hi @alexed1, really sorry for the delay, I was away on annual leave for the last month-and-a-half.

@ericrsmith35 I think the behaviour makes sense, because the flow you're testing on requires the user to exit the modal with the X button, rather than with a 'Finish' button. The intended purpose of this component was to auto-close screen flows triggered from quick actions and URLs, but not from a CPE.

@alexed1's summary from July 1st is spot on as to why I created these components, as I felt the existing alternatives weren't meeting the requirements I needed.

({
invoke : function(component, event, helper) {
return new Promise(function(resolve, reject) {
$A.get("e.force:refreshView").fire();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you compare the functionality of refreshView to what's in this local action: https://github.com/forcedotcom/LightningFlowComponents/tree/master/flow_local_actions/UpdateScreen

@alexed1 alexed1 merged commit 2e5afde into UnofficialSF:master Jan 14, 2023
@alexed1
Copy link
Collaborator

alexed1 commented Jan 22, 2023

As Eric pointed out, this code would need to make a distinction between NEXT and FINISH. If you put this component on the last screen of a flow it will throw an error because NEXT is not an allowable option.

@alexed1
Copy link
Collaborator

alexed1 commented Jan 22, 2023

So that I can explain it, I want to better understand the difference between the force:recordData (which is what UpdateScreen uses) and florce:refreshView, which is provided here.

I notice that the documentation for refreshView says 'it's preferable to use recordData' down at the bottom of the page (https://developer.salesforce.com/docs/component-library/bundle/force:refreshView/documentation)

I'm happy to have both in the repo if they're not overlapping. What's the advantage as you see it of refreshView?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants