I'm trying to set a boolean field to False when a lightning component on the case object is clicked.
Component
<aura:component controller="UnescalateController" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:at>tribute name="CaseObj" type="Case" default="{ 'sobjectType' : 'case'}"/>
<lightning:button label="Unescalate" onclick="{! c.unescalate}"/>
</aura:component>
JS Controller
({
unescalate : function(component, event, helper) {
var caseObject = component.get("v.CaseObj");
caseObject.Admin_Escalation__c = FALSE;
var action = component.get("c.updateAdmin_Escalation__c");
action.setParams({
obj: caseObject,
oId : component.get("v.recordId")
});
// set call back
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
alert('This case has been unescalated!');
$A.get('e.force:refreshView').fire();
}
else if (state === "INCOMPLETE") {
alert("From server: " + response.getReturnValue());
} else if (state === "ERROR") {
var errors = response.getError();
if (errors) {
if (errors[0] && errors[0].message) {
console.log("Error message: " + errors[0].message);
}
} else {
console.log("Unknown error");
}
}
});
// enqueue the action
$A.enqueueAction(action);
}
})
I'm pretty new to lightning components and have been playing around for a while. I'm specifically getting the following error : Uncaught Action failed: c:UnEscalate$controller$unescalate [FALSE is not defined] Any help would be greatly appreciated.
caseObject.Admin_Escalation__c = false;
?