---
schema_version: "1"
id: 27842323f18a4eeff75140269c70ae67c688db6856ae8ab0d8d0ec4111d116cf
title: setCallback()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/ref-jsapi/ref-jsapi-action-setcallback.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-action-setcallback.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: cc75fea6ad7f4a9aa2ac08cb9178d4d0dfede235f0c74c9e960763c04cb26299
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# setCallback()

Sets the callback function that is executed after an Apex action returns.

## Signature

`setCallback (Object scope, function callback, String name)`

## Parameters

**_scope_:** Type: `Object`. The scope in which the function is executed. Always set this parameter to the keyword `this`.

**_callback_:** Type: `function`. The callback to invoke after the Apex action returns.

**_name_:** Type: `String`. Defaults to "ALL" which registers callbacks for the "SUCCESS", "ERROR", and "INCOMPLETE" states.

**See Also**  


-   [Calling a Server-Side Action](https://developer.salesforce.com/docs/platform/aura-platform/controllers-server/controllers-server-actions-call.md)
-   [Action States](https://developer.salesforce.com/docs/platform/aura-platform/controllers-server/controllers-server-actions-states.md)

