I gotta tell ya! I was pretty darn impressed with myself after finding this!
So what are we addressing here?
Simply put, the idea here is to auto fire(or navigate to) a quick action. There can be different kinds of use cases around this.
The one I recently came across was a customer wanting to auto fire a quick action as soon as a particular flow finishes.
My initial thought was to use Publisher API for this which involved writing code(lightning components). As expected, it worked. BUT, what I didn’t expect was how awfully slow it was. The publisher API took almost 4-5 seconds on an average to fire the action.
Then the customer came in saying they do not want to show the action on the page layout. And, for Publisher API to work, the quick action must be added to the page layout.
Yeah, that’s life!
But somehow, I managed to pull it through.
To resolve this, I noticed the URL pattern when a quick action fires, and it looked something like this:
<domain>.salesforce.com/lightning/action/quick/ObjectApiName.QuickActionApiName?recordId=0036F00003euXjdQAE&backgroundContext...
And voila!
All I had to do was create a super simple component which navigated from the flow to the Quick Action URL. And guess what, it was “lightning” fast and you can fire the action even if it’s not on the layout.
Isn’t that cool! Try it out and let me know what you think. Tell me where do you think you’d want to implement this!
I’ll catch you in the next one! ✌
Thank you for being an awesome reader! Subscribe to this blog for receiving all the latest updates straight to your inbox. 🙂
Narender Hi,
Your solution sounds great!
Can you share with us a sample of the component?
Thanks!
Gidi
LikeLike
Hey Gidi,
I don’t have the component code with me at the moment but it was very similar to what Eric Smith’s navigateAnywhere component.
LikeLike
Okay, thanks Narender 👍
LikeLike
Pingback: From Narender Singh: Launch a Quick Action at the End of a Flow – UnofficialSF
Do you know the URL hack for doing the same thing for Global Actions?
LikeLike
Unfortunately, no. I tried, but the URL doesn’t seem to be changing for global actions.
LikeLike
Do you know if there’s a way to launch the Compare and Merge dialog on a Duplicate Record Set page?
LikeLike
You should be able to add the Compare and Merge button to the page layout of Duplicate Record Set page.
LikeLike
Thanks! I am redirecting to the Duplicate Record Set page at the end of the flow, but I don’t want my users to need to click the Compare and Merge button. I was hoping there was a way to get the Compare and Merge screen to pop up automatically.
LikeLike
Umm, there might be a possibility.
The solution, however, is a bit hacky and involves writing some code(creating a lightning component), and also if something changes on the Salesforce side , it might break and the solution may need a repair.
So I’m not sure if it’s worth it.
LikeLike
Oh well! Thanks for responding
LikeLike
Pingback: Say Hi to the NEW WAY of launching Flow via URL | forcePanda
Clever!
LikeLike
Hehe, thanks! 😁
LikeLike
Cleaver bro. Does this work in salesforce mobile app as well? what should be url format for mobile approach and code snippet please.
LikeLike
I’m not sure this would work with app.
It’ll probably require some hit and trial attempt to see if there is any way to make it work for mobile app.
LikeLike
This was dope; worked perfectly for my use case!
LikeLike
Hi Narendra, I want to open New Opportunity page after i have done something. For me below url is not working. Do you know where i can find the appropriate quickactionName ?
/lightning/action/quick/Opportunity.NewOpportunity?recordtypeId=012200000005QsjAAE
LikeLike
Do you want to use the quick action or the ‘New’ button to create the opportunity?
LikeLike
Thanks for your reply. Actually my New button is overridden. If i use something like below : /lightning/o/Opportunity/new?defaultFieldValues={!Opportunity.RecordTypeId}=012200000005QsjAAE
It navigates to overridden page. I am looking to open standard Opportunity creation page. I though quick action may help here.
LikeLike
I see. Quick action can definitely help. But you will have to first create a quick action on the object from which you’re attempting to create the opportunity.
There “might” be a standard action already. If not, then simply create a new one.
LikeLike
Why its not working on domain cs219.force.com ?
LikeLike
Are you hardcoding the domain in the URL?
LikeLike
No, only from /lightning/action…
It’s forwarded to the Not found page.
Thanks
LikeLike
It could be that Salesforce changed its URL structure in the new release. You might have to update the URL accordingly.
LikeLike
Hi i figured out that the solution is working perfectly but I’m in a bit different use case.
I need to launch a screen flow quick action from a record page which contains an LWC that gathers some information (needed in the screen flow)
I tried to call the quick action with the same method but even if I write down:
“domain/quickAction&flowInput=” + encodeURIComponent(JSON.stringify((this.data)))
the flowInput variable is not correctly populated in the screen flow and it does not work
LikeLike
You cannot pass parameters to flow via this method I’m afraid. You can only pass record ID using this method. If you want to send the data, then you should invoke the flow from the component itself.
Note: LWC can’t call flow if I remember correctly, so you’d need an aura wrapper to call the flow.
LikeLike
I would like to launch a Quick Action to create a record from a hyperlink formula field instead of a button on the parent record so I could launch it from a List View or Related List. It seems like such a basic thing to do, but I can’t seem to find anything on this. Is it possible?
LikeLike
Sounds possible. What’s the issue you’re facing?
LikeLike
I want to launch the Quick Action from a button using the HTML Editor component in an Experience Cloud stie. I have a custom Notes related object to the Opportunity object. I have successfully created the Quick Action to create the Note on the Opportunity but I want to place my button somewhere else on the page so I was hoping to use the URL for the Quick Action in the HTML Editor component which be used as a button. Is this possible and if so what would the URL to launch the Quick Action be? Thanks
LikeLike