I created a lightning component button I added them in to the page layout. I tried to do with the Lightning App Builder the button show up when I click nothing happens. The lightning component button is like below Component
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="setCaseClose">
<aura:attribute name="updateCase" type="Case" default="{'sobjectType':'Case'}"/>
<lightning:button variant="brand" label="Close Case" onclick="{!c.updateCaseClose}" />
</aura:component>
Controller
({
updateCaseClose : function(c, e, h) {
h.updateCaseClose_helper(c,e,h);
},
})
Helper
({
updateCaseClose_helper : function(c,e,h) {
var save_action = c.get("c.updateCheck");
save_action.setParams({
});
$A.enqueueAction(save_action);
}
})
Apex Class
public class setCaseClose {
@AuraEnabled
public static void updateCheck(){
list<Case> Case_list = new list<Case>();
Case_list = [select id,Status from Case Limit 1];
Case p = new Case();
p.id = Case_list[0].id;
p.Status = 'Closed';
update p;
}
}
The button shows up in the page
Clicking on it nothing happens, not what I am missing here.
$A.get("e.force:refreshView").fire()