You need to sign in to do that
Don't have an account?

Aura component close after create record
Hello All,
I am using an aura compone to override a new button. But the cancel does not have any effect and the window does not close after save.
If I stick the aura in a quick action it works but not when I use it to override the 'new' button. Any thoughts?
I am using an aura compone to override a new button. But the cancel does not have any effect and the window does not close after save.
If I stick the aura in a quick action it works but not when I use it to override the 'new' button. Any thoughts?
In HTML:
<lightning:navigation aura:id="navService"/>
in js controller or helper after record is created:
component.find("navService") .navigate({
"type" : "standard__recordPage",
"attributes": { "recordId" : "001xxxxxxxxx",
"objectApiName": "Account",
"actionName": "view"
} }, true);
You may get more details here:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation_dfv.htm
All Answers
$A.get("e.force:closeQuickAction").fire();
This is not a quick action. I am overriding the standard 'New' button so this opens a page and not a module. Will this still work? Does your example go in the helper.js?
Thanks
In HTML:
<lightning:navigation aura:id="navService"/>
in js controller or helper after record is created:
component.find("navService") .navigate({
"type" : "standard__recordPage",
"attributes": { "recordId" : "001xxxxxxxxx",
"objectApiName": "Account",
"actionName": "view"
} }, true);
You may get more details here:
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation_dfv.htm
you cabn use on cancel button:-
$A.get("e.force:closeQuickAction").fire();
and make sure you are not implementing lightningQuickActionWithoutHeader in component
If this solution is usefull for you, Please mark as a Best Answer to help others.
Regards
Mukesh