Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created January 24, 2023 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/3608641dbe158c69cac3a0935933c0c5 to your computer and use it in GitHub Desktop.
Save arun12209/3608641dbe158c69cac3a0935933c0c5 to your computer and use it in GitHub Desktop.
({
handleDestroy : function (component, event, helper) {
var val = event.getParam("value");
// Do something else here
var action = component.get("c.clearData");
action.setParams({
recId : component.get("v.recordId")
});
// Create a callback that is executed after
// the server-side action returns
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
// Alert the user with the value returned
// from the server
console.log("From server: " + response.getReturnValue());
// You would typically fire a event here to trigger
// client-side notification that the server-side
// action is complete
}
});
$A.enqueueAction(action);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment