The component is not using the ‘DisplayCaseController’ Apex controller

The component is not using the ‘DisplayCaseController’ Apex controller

Use the below code:

Controller Code:

({
    getCase: function(cmp){
        var action = cmp.get(“c.getCaseFromId”);
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === “SUCCESS”) {
                cmp.set(“v.record”, response.getReturnValue());
            }
        });
$A.enqueueAction(action);
    }
})

Component Code:

<aura:component controller=”DisplayCaseController”>
<aura:attribute name=”record” type=”Case”/>
    <ui:button label=”Get Case” press=”{!c.getcase}”/>
    <p>{!v.record.Status}</p>
        <p>{!v.record.Subject}</p>
        <p>{!v.record.Description}</p>
</aura:component>


Cheers!!!

Leave a Reply