5

I have a object and i create a list button on object to delete the all records on click on button and add that button on record list view page, somehow that is working fine in salesforce classic but not showing that field in lightning..so for that i create a lightning compenent.This compenent is working fine that i want but this is not showing on Object list view page.i go in search layout and edit the list view and create mew actionit create successful but not showing in the available list there. i want to add it here in image:-enter image description here

i want to add new button on side of New but i always get blank options there:- enter image description here

this is the component that i tried yet:-

    <aura:component controller="SFDCClearLogs" implements="force:appHostable,force:lightningQuickActionWithoutHeader,flexipage:availableForAllPageTypes,force:hasRecordId" access="global" >

<aura:attribute name="events" type="SFDC_Project__c[]"/>

<lightning:button aura:id="deleteDataButton"
                     label="Delete Data"
                     class="slds-button slds-button__icon--left slds-button--destructive"
                     onclick="{!c.doDelete}" 
                     iconName="utility:delete"
              />

</aura:component>

and this is the controller class that is calling in it:--

    ({

    doDelete: function(component, event, helper){
        var action = component.get("c.doClearSfdcProject");
         action.setCallback(this, function(response){
        var state = response.getState();
        var resultsToast = $A.get("e.force:showToast");
        // var dismissActionPanel = $A.get("e.force:closeQuickAction");


        if (state === "SUCCESS") {
                 resultsToast.setParams({
                "title": "Delete!",
                "message": "Data were succesfully deleted.",
                "type": "other",
                "key":"delete"
            });
               $A.get("e.force:closeQuickAction").fire()
                resultsToast.fire();
                // dismissActionPanel.fire();
        }
    });
         $A.enqueueAction(action);
    },
})

how i did changes in my code that it will show in list view actions? i also give this user Mass Cases and Customize aplication permission.

  • The only way I see would be to create a lightning application which embeds your lightning component inside. Then, you could create, a custom list view button of type url which redirects to the url of your lightning application. – Martin Lezer Mar 28 '18 at 10:01
  • can you elobrate it more that how can i add this in list view button of type? – sonam Mar 28 '18 at 10:15
  • i have got the solution from flow we can do this. – sonam Mar 29 '18 at 7:46
  • @sonam I have the exact requirement and not finding solutions. Can you explain it? – Sagar Hinsu Aug 2 '18 at 10:07
  • @AnjiPunyamanthula for this i used flow but not get complete success. But you can try once this can be solved with flow. – sonam Aug 2 '18 at 10:36
0

I got bit by this today. Unfortunately, you cannot add a lightning component Quick Action to a listview.

Per this document:

You can perform mass quick actions on only the following quick action types: Create a Record and Update a Record.

0

Lightning Experience does support custom Visualforce-based buttons on list views. You could create a Visualforce page that receives the list of selected items (see here for more info https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_massupdate.htm). You could give it a Lightning-like UI (using SLDS or lightningStylesheets="true") that asks for confirmation and then completes the action on the click of a button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.