I created a quick action named 'Create Opp' on Account to create an Opportunity and launch it in lightning experience from the Account detail page. I am able to create the Opportunity record successfully. My requirement is to redirect to the created Opportunity page which is not happening. Is there any workaround to achieve this?
[SalesForce] Unable to redirect to the record created using Quick Action in lightning experience
Related Solutions
You can try force:refreshView, which reloads all data for the view. So in addition to $A.get("e.force:closeQuickAction").fire();
add $A.get('e.force:refreshView').fire();
in your setCallback method.
({
handleClick : function(component, event, helper) {
var saveLeadAction = component.get("c.leadSave");
saveLeadAction.setCallback(this, function(a) {
if (a.getState() === "SUCCESS") {
$A.get("e.force:closeQuickAction").fire();
$A.get('e.force:refreshView').fire();
}else if (res.getState() === "ERROR") {
console.log("Errore Saving Contact ");
}
});
$A.enqueueAction(saveLeadAction);
}
})
It could be many things. Below is a general troubleshooting list for a quick action (QA) that doesn't appear on record pages:
- Does the user have access to the object the QA is creating?
- If it's
Log a Call
- does the user haveAccess Activities
permission? - If it's
Send Email
, does the user haveSend Email
permissions and is email deliverability turned "on" where you're testing? - Does the user have record type access to the record type defined in the QA?
- If it's a VF, Aura, or LWC QA - does the user have apex access to the controller (if one is used).
- If it's a flow QA - does the user have the
Run Flows
permission orFlow User
checkbox on their User record? Is the Flow activated? - Is the page layout you added the QA defined in the page layout assignment for your profile for that record type of the record you're testing on?
- Do you have a lightning page defined? Is it using dynamic actions? You'll have to add the QA to the dynamic actions on the lightning page itself.
- Is the object you added the QA to a Case, Work Order, or User? This works differently in where the QA appears as noted in Actions in Lightning Experience. Depending on if feed tracking is enabled, you may see the QA in the chatter tab - utilizing dynamic actions will let you put the QA where you'd like (see this answer)
Below are more details on how to check each of the above
Setup --> Profiles --> UserProfile
. Go toStandard Object Permissions
orCustom Object Permissions
to check it has create/update access.
Setup --> Profiles --> UserProfile
. Under General User Permissions, there's theAccess Activities
permission that needs to be checked.
Setup --> Profiles --> UserProfile
. Under General User Permissions, there's aSend Email
permission. For Email Deliverability, go toSetup --> Deliverability
and make sure Access Level is set toAll Email
Setup --> Profiles --> UserProfile
. Go toRecord Type Settings
, do you see the record type listed next to the object? If not, clickedit
and add it.
Setup --> Apex Classes --> YourApexClass
. Click onSecurity
and make sure the user's profile is added to the list.
- Go to your profile and, under General User Permission, check if
Run Flows
is enabled. Otherwise, go to the user record itself and see ifFlow User
is checked.
Setup --> Object Manager --> YourObject --> Page Layouts
. ClickPage Layout Assignment
and confirm the page layout you updated is assigned for the record type of the record you're on (not necessarily the one you may be creating in the QA).
Setup --> Object Manager --> YourObject --> Lightning Record Pages
. You may need to look atView Page Assignments
or what is theOrg Default
page, but once you figure out which page is displayed to your user, click into it and edit it. On your highlights panel, do you see anAdd Action
button or anUpgrade to Dynamic Actions
. If you see anAdd Action
, you'll have to add your QA there.
Best Answer
It appears this is still not a standard function for salesforce, but I found this work around. You can drag and drop this lightning component to any lightning page your quick action is on and it will redirect to the newly created record. It uses the link from the default success toast message so be sure to leave the 'Success Message' field blank.
Hope it helps. Link and OP at the bottom
-Mateusz Otręba November 15, 2019
https://salesforceprofs.com/navigate-to-created-record/