{"id":88035,"date":"2017-07-04T06:15:07","date_gmt":"2017-07-04T06:15:07","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=88035"},"modified":"2018-11-19T06:47:21","modified_gmt":"2018-11-19T06:47:21","slug":"mass-delete-lightning-component","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/","title":{"rendered":"Mass Delete In Lightning Component"},"content":{"rendered":"<p>In this blog we will learn how to delete selected (mass delete) record on button click in Salesforce Lightning Component.<\/p>\n<div class=\"panel panel-default\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Steps:<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<div>\n<p>Steps to add the custom button and perform Mass Delete of selected record.<\/p>\n<p>Step 1: \u00a0 Create a lightning component and add following code.<\/p>\n<pre class=\"brush:java\">&lt;aura:component implements=\"force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes\" access=\"global\" controller=\"accListClass\" &gt;\r\n    &lt;aura:attribute name=\"account\" type=\"List\"&gt;&lt;\/aura:attribute&gt;\r\n    &lt;aura:handler name=\"init\" value=\"{!this}\" action=\"{!c.accountList}\"&gt;&lt;\/aura:handler&gt;\r\n    &lt;div class=\"slds-grid\"&gt;\r\n        &lt;div class=\"slds-col slds-p-horizontal_small slds-size_1-of-2 slds-medium-size_5-of-6 slds-large-size_8-of-12\"&gt;&lt;\/div&gt;\r\n        &lt;div class=\"slds-col slds-size_1-of-8 allBtn\"&gt;&lt;lightning:button label=\"Delete Selected\"\r\n                                              iconName=\"utility:delete\"\r\n                                              iconPosition=\"left\"\r\n                                              variant=\"destructive\"\r\n                                              onclick=\"{!c.deleteSlctd}\"&gt;\r\n                            &lt;\/lightning:button&gt;&lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;table class=\"slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer slds-table--fixed-layout\"&gt;\r\n        &lt;thead&gt;\r\n        \t&lt;tr class=\"slds-text-heading--label\"&gt;\r\n                &lt;th scope=\"row\" style=\"width: 50px;\" class=\"slds-text-align--right\"&gt;&lt;ui:inputCheckbox aura:id=\"cbox\" class=\"cBox\" change=\"{!c.selectAll}\"\/&gt;&lt;\/th&gt;\r\n                &lt;th scope=\"row\"&gt;&lt;div class=\"slds-truncate\" title=\"ID\"&gt;ID&lt;\/div&gt;&lt;\/th&gt;\r\n                &lt;th scope=\"row\"&gt;&lt;div class=\"slds-truncate\" titile=\"NAME\"&gt;Name&lt;\/div&gt;&lt;\/th&gt;\r\n                &lt;th scope=\"row\"&gt;&lt;div class=\"slds-truncate\" title=\"INDUSTRY\"&gt;Industry&lt;\/div&gt;&lt;\/th&gt;\r\n                &lt;th scope=\"row\"&gt;&lt;div class=\"slds-truncate\" title=\"PHONE\"&gt;Phone&lt;\/div&gt;&lt;\/th&gt;\r\n            &lt;\/tr&gt;\r\n        &lt;\/thead&gt;\r\n        &lt;tbody&gt;\r\n            &lt;aura:iteration items=\"{!v.account}\" var=\"a\"&gt;\r\n            \t&lt;tr&gt;\r\n                    &lt;td&gt;&lt;ui:inputCheckbox aura:id=\"cboxRow\" text=\"{!a.Id}\" class=\"cBox\" change=\"{!c.changeSelectAll}\"\/&gt;&lt;\/td&gt;\r\n                \t&lt;th&gt;&lt;div class=\"slds-truncate\"&gt;{!a.Id}&lt;\/div&gt;&lt;\/th&gt;\r\n                    &lt;td&gt;&lt;div class=\"slds-truncate\"&gt;{!a.Name}&lt;\/div&gt;&lt;\/td&gt;\r\n                    &lt;td&gt;&lt;div class=\"slds-truncate\"&gt;{!a.Industry}&lt;\/div&gt;&lt;\/td&gt;\r\n                    &lt;td&gt;&lt;div class=\"slds-truncate\"&gt;{!a.Phone}&lt;\/div&gt;&lt;\/td&gt;\r\n                &lt;\/tr&gt;\r\n            &lt;\/aura:iteration&gt;\r\n        &lt;\/tbody&gt;\r\n    &lt;\/table&gt;\r\n&lt;\/aura:component&gt;\r\n\r\n\r\n<\/pre>\n<p>Step 2: Create the client side controller of above mentioned Component and add the following code.<\/p>\n<pre class=\"brush:java\">({\r\n    accountList : function(component, event, helper) {\r\n        helper.getAccountList(component);\r\n    },\r\n    selectAll: function(component,event, helper){\r\n        var slctCheck = event.getSource().get(\"v.value\");\r\n        var getCheckAllId = component.find(\"cboxRow\");\r\n        \r\n        if (slctCheck == true) {\r\n            for (var i = 0; i &lt; getCheckAllId.length; i++) {\r\n                component.find(\"cboxRow\")[i].set(\"v.value\", true);             \r\n            }\r\n        } else {\r\n            for (var i = 0; i &lt; getCheckAllId.length; i++) {\r\n                component.find(\"cboxRow\")[i].set(\"v.value\", false);\r\n            }\r\n        }\r\n    },\r\n    changeSelectAll:function(component,event, helper){\r\n        var slctCheckRow = event.getSource().get(\"v.value\");\r\n        var getCheckAllId = component.find(\"cbox\");\r\n        if(slctCheckRow == false) {\r\n            component.find(\"cbox\").set(\"v.value\", false);\r\n        }\r\n    },\r\n    deleteSlctd : function(component,event,helper) {\r\n        var getCheckAllId = component.find(\"cboxRow\");\r\n        var selctedRec = [];\r\n        for (var i = 0; i &lt; getCheckAllId.length; i++) {\r\n            \r\n            if(getCheckAllId[i].get(\"v.value\") == true )\r\n            {\r\n                selctedRec.push(getCheckAllId[i].get(\"v.text\")); \r\n            }\r\n        }\r\n        helper.deleteSelected(component,event,selctedRec);\r\n    }\r\n})<\/pre>\n<p>Step 3: Now create the helper controller of above mentioned Component and add the following code.<\/p>\n<pre class=\"brush:java\">({\r\n    getAccountList : function(component) {\r\n        var action = component.get(\"c.getAccounts\");\r\n        var self = this;\r\n        action.setCallback(this, function(actionResult){\r\n            component.set(\"v.account\",actionResult.getReturnValue());\r\n        });\r\n        $A.enqueueAction(action);\r\n    },\r\n    deleteSelected : function(component,event,selctedRec){\r\n        var action = component.get(\"c.delSlctRec\");\r\n        action.setParams({\r\n            \"slctRec\": selctedRec\r\n        });\r\n        action.setCallback(this, function(response){\r\n            var state =  response.getState();\r\n            if(state == \"SUCCESS\")\r\n            {\r\n                component.set(\"v.account\",response.getReturnValue());\r\n                console.log(\"Successfully Deleted..\");\r\n            }else if (state==\"ERROR\") {\r\n                console.log(action.getError()[0].message);\r\n        });\r\n        $A.enqueueAction(action);<\/pre>\n<pre class=\"brush:java\">    }\r\n})<\/pre>\n<p>Step 4: Last step create the apex class name accListClass and add the following code.<\/p>\n<pre class=\"brush:java\">public class accListClass{\r\n    @AuraEnabled \r\n    public List&lt;Account&gt; accList = new List&lt;Account&gt;();\r\n    \r\n    @AuraEnabled \r\n    public List&lt;Account&gt; delRec = new List&lt;Account&gt;();\r\n    \r\n    @AuraEnabled \r\n    public static List&lt;Account&gt; getAccounts(String query)\r\n    {\r\n        accListClass alc = new accListClass();\r\n        \r\n        alc.accList = Database.query('SELECT Id,Name,Phone,Industry from Account');\r\n                \r\n        return alc.accList;\r\n    }\r\n   \r\n    @AuraEnabled \r\n    public static List&lt;Account&gt; delSlctRec(List&lt;String&gt; slctRec)\r\n    {\r\n        accListClass alc = new accListClass();\r\n        alc.delRec = [SELECT Id FROM Account WHERE Id IN: slctRec ];\r\n       try{\r\n           delete alc.delRec;\r\n           } catch(Exception ex)\r\n          {\r\n             throw new AuraHandledException(ex.getMessage());\r\n          }\r\n        alc.accList = Database.query('SELECT Id,Name,Phone,Industry from Account');\r\n                \r\n        return alc.accList;\r\n       \r\n    }\r\n}<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"panel panel-default\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Output<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<p>Select all the record. To implement the pagination in lightning component\u00a0<a href=\"https:\/\/webkul.com\/blog\/implementing-pagination-lightning-component-salesforce\/\" target=\"_blank\" rel=\"noopener noreferrer\">Click Here<\/a><\/p>\n<p><a href=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-3.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"alignnone wp-image-88188 size-full\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-3.jpg\" alt=\"\" width=\"1301\" height=\"629\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-3.jpg 1301w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-3-250x121.jpg 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-3-300x145.jpg 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-3-768x371.jpg 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-3-1200x580.jpg 1200w\" sizes=\"(max-width: 1301px) 100vw, 1301px\" loading=\"lazy\" \/><\/a><\/p>\n<p>Click on the button to delete records:<\/p>\n<p><a href=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-4.jpg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"alignnone wp-image-88189 size-full\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-4.jpg\" alt=\"\" width=\"1301\" height=\"629\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-4.jpg 1301w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-4-250x121.jpg 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-4-300x145.jpg 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-4-768x371.jpg 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/Lightning-Experience-Salesforce-4-1200x580.jpg 1200w\" sizes=\"(max-width: 1301px) 100vw, 1301px\" loading=\"lazy\" \/><\/a><\/p>\n<\/div>\n<\/div>\n<div class=\"panel panel-default\">\n<div class=\"panel-heading\">\n<div>\n<h3 class=\"panel-title\">Support<\/h3>\n<\/div>\n<\/div>\n<div class=\"panel-body\">\n<p>That\u2019s all for implementation of mass delete in lightning component, still if you have any further query or seek assistance to make your salesforce classic apps compatible with lightning experience, feel free to add a ticket, we will be happy to help you .\u00a0<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/<\/a><\/p>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog we will learn how to delete selected (mass delete) record on button click in Salesforce Lightning Component. Steps: Steps to add the custom button and perform Mass Delete of selected record. Step 1: \u00a0 Create a lightning component and add following code. &lt;aura:component implements=&#8221;force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes&#8221; access=&#8221;global&#8221; controller=&#8221;accListClass&#8221; &gt; &lt;aura:attribute name=&#8221;account&#8221; type=&#8221;List&#8221;&gt;&lt;\/aura:attribute&gt; &lt;aura:handler name=&#8221;init&#8221; <a href=\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":145,"featured_media":88043,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3554,1887],"tags":[4998,3030,1885],"class_list":["post-88035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lightning-development","category-salesforce","tag-lightning-component","tag-mass-delete","tag-salesforce"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Mass Delete In Lightning Component - Webkul Blog<\/title>\n<meta name=\"description\" content=\"In this blog we will learn how to delete selected (mass delete) record on button click in Salesforce Lightning Component.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mass Delete In Lightning Component - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"In this blog we will learn how to delete selected (mass delete) record on button click in Salesforce Lightning Component.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-04T06:15:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-19T06:47:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Snehil Jaiswal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Snehil Jaiswal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/\"},\"author\":{\"name\":\"Snehil Jaiswal\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/e7e387ae1eb38a5dd56c53c2daf848d1\"},\"headline\":\"Mass Delete In Lightning Component\",\"datePublished\":\"2017-07-04T06:15:07+00:00\",\"dateModified\":\"2018-11-19T06:47:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/\"},\"wordCount\":167,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png\",\"keywords\":[\"Lightning Component\",\"Mass delete\",\"Salesforce\"],\"articleSection\":[\"Lightning Development\",\"Salesforce\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/\",\"url\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/\",\"name\":\"Mass Delete In Lightning Component - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png\",\"datePublished\":\"2017-07-04T06:15:07+00:00\",\"dateModified\":\"2018-11-19T06:47:21+00:00\",\"description\":\"In this blog we will learn how to delete selected (mass delete) record on button click in Salesforce Lightning Component.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png\",\"width\":825,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mass Delete In Lightning Component\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/e7e387ae1eb38a5dd56c53c2daf848d1\",\"name\":\"Snehil Jaiswal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4bca6424a95aaafa9ab0ddc940099d65d20ab159fbcec826869a62578336590d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4bca6424a95aaafa9ab0ddc940099d65d20ab159fbcec826869a62578336590d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Snehil Jaiswal\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/snehil-jaiswal901\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mass Delete In Lightning Component - Webkul Blog","description":"In this blog we will learn how to delete selected (mass delete) record on button click in Salesforce Lightning Component.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/","og_locale":"en_US","og_type":"article","og_title":"Mass Delete In Lightning Component - Webkul Blog","og_description":"In this blog we will learn how to delete selected (mass delete) record on button click in Salesforce Lightning Component.","og_url":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2017-07-04T06:15:07+00:00","article_modified_time":"2018-11-19T06:47:21+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png","type":"image\/png"}],"author":"Snehil Jaiswal","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Snehil Jaiswal","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/"},"author":{"name":"Snehil Jaiswal","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/e7e387ae1eb38a5dd56c53c2daf848d1"},"headline":"Mass Delete In Lightning Component","datePublished":"2017-07-04T06:15:07+00:00","dateModified":"2018-11-19T06:47:21+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/"},"wordCount":167,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png","keywords":["Lightning Component","Mass delete","Salesforce"],"articleSection":["Lightning Development","Salesforce"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/","url":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/","name":"Mass Delete In Lightning Component - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png","datePublished":"2017-07-04T06:15:07+00:00","dateModified":"2018-11-19T06:47:21+00:00","description":"In this blog we will learn how to delete selected (mass delete) record on button click in Salesforce Lightning Component.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2017\/07\/download.png","width":825,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/mass-delete-lightning-component\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Mass Delete In Lightning Component"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/e7e387ae1eb38a5dd56c53c2daf848d1","name":"Snehil Jaiswal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4bca6424a95aaafa9ab0ddc940099d65d20ab159fbcec826869a62578336590d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4bca6424a95aaafa9ab0ddc940099d65d20ab159fbcec826869a62578336590d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Snehil Jaiswal"},"url":"https:\/\/webkul.com\/blog\/author\/snehil-jaiswal901\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/88035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/145"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=88035"}],"version-history":[{"count":13,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/88035\/revisions"}],"predecessor-version":[{"id":151597,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/88035\/revisions\/151597"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/88043"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=88035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=88035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=88035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}