More Related Content
Similar to Sfdgr 12 20180906_answer_v1.0
Similar to Sfdgr 12 20180906_answer_v1.0 (20)
More from Ikou Sanuki(16)
Sfdgr 12 20180906_answer_v1.0
- 2. Apex OpportunityTableController
2
public class OpportunityTableController {
@AuraEnabled
public static List<Opportunity> getOpportunities (String accId) {
List<Opportunity> oppList = [SELECT
id,Name
,StageName
,Amount
FROM
Opportunity
WHERE
AccountId = :accId
AND isClosed = false
];
return oppList;
}
}
- 6. LightningComponent HELPER
6
({
getOpps : function(component,event) {
var action = component.get("c.getOpportunities");
action.setParams({
"accId" : component.get("v.recordId")
});
action.setCallback(this, function(response) {
var result = response.getReturnValue();
component.set("v.oppList", result);
});
$A.enqueueAction(action);
}
})