Skip to content

Instantly share code, notes, and snippets.

@choudharymanish8585
Created November 18, 2018 09:07
Show Gist options
  • Save choudharymanish8585/27f326ae18f90baad55546edbaed0d61 to your computer and use it in GitHub Desktop.
Save choudharymanish8585/27f326ae18f90baad55546edbaed0d61 to your computer and use it in GitHub Desktop.
({
/**
* This function gets object list
* @author - Manish Choudhari
* */
getObjectList : function(component) {
var action = component.get("c.getObjects");
action.setCallback(this,function(response) {
var state = response.getState();
if (state === "SUCCESS") {
component.set("v.allObjects", response.getReturnValue());
component.set("v.filteredObjects", response.getReturnValue());
}
});
$A.enqueueAction(action);
},
/**
* This function gets record list
* @author - Manish Choudhari
* */
getRecordList : function(component, selectedObject) {
var action = component.get("c.getRecords");
action.setParams({
'objectName' : selectedObject
});
action.setCallback(this,function(response) {
var state = response.getState();
if (state === "SUCCESS") {
component.set("v.records", response.getReturnValue());
}
});
$A.enqueueAction(action);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment