-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDynamicDataTableWithFieldSetController.js
More file actions
30 lines (28 loc) · 1.06 KB
/
DynamicDataTableWithFieldSetController.js
File metadata and controls
30 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
({
doInit : function(component, event, helper) {
var action = component.get('c.getAccounts');
action.setParams({'strObjectName' : 'Account',
'strFieldSetName' : 'MyFieldSet'});
action.setCallback(this, function(response){
var state = response.getState();
if(state === 'SUCCESS') {
component.set('v.myData', response.getReturnValue().lstDataTableResponse);
component.set('v.columns', response.getReturnValue().lstDataColumns);
}
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");
}
}else{
console.log('Something went wrong, Please check with your admin');
}
});
$A.enqueueAction(action);
}
})