0

Tried searching for this but was not able to find a definitive answer. I don't think it's possible as I've been trying, but can I disable a quick action button in lightning experience.

I have a quick action that is linked to a lightning component. I have a doInit but that doesn't seem to take affect unless I actually click on the button.

Essentially when the page loads without having to do anything based on certain conditions I would like for the quick action button to be disabled. Is this possible? From various testing and search this does not seem to be the case. Thank you.

1
  • 1
    We can't hide a quick action, but we can create multiple page layouts to show/hide the quick action buttons based on the data we have for the current record. Commented Jan 24, 2019 at 13:04

3 Answers 3

2

Hope, you've created a quick action button with Lightning Component.

Lightning component will be fired only on button click. You cannot disable a quick action. Instead you can throw some message from your doInit function if the conditions are not met.

Hope this helps.

1

To resolve your issue I would use ui:button.

<ui:button label="test" aura:id="myButton"/>

And in doInit call something like this:

({ doInit : function(component, event, helper) { 
var button = component.find("myButton"); 
$A.util.addClass(button.getElement(), 'slds-hide');})

And after conditions to show this button would be met:

$A.util.addClass(button.getElement(), 'slds-show');
0

i m not much familiar to lightning but if you are talking to hide fuctionality of cancel save llike buttons you can use

showQuickActionVfHeader=false

1
  • We implement this to hide the quick action modal button, no to disable the quick action button which loads the lightning component inside the modal with the cancel button. Commented May 25, 2018 at 9:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .