---
schema_version: "1"
id: 764a07426562a9edc6b93746a91b2cd4cfa86d54b0aef71b394a8e695253a839
title: Handling the Remote Response
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/javascript/pages-js-remoting-handling-response.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-js-remoting-handling-response.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4230ebe9e7787a5f9e212cf0464c0460025334e8a0e4176004b7a61b9b37fc8c
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Handling the Remote Response

Handle the response to a remote method call asynchronously in the remote method callback function.

Your callback function receives the following parameters:

-   `event` object representing the status of the remote call
-   `result` object returned by the remote Apex method.

Your function can update information and user interface elements on the page based on the data returned.

The `event` object provides values that let you act upon the success or failure of the remote call.

|Field|Description|
|-----|-----------|
|`event.status`|`true` on success, `false` on error.|
|`event.type`|The type of the response: `rpc` for a successful call, `exception` if the remote method threw an exception.|
|`event.message`|Contains any error message that is returned.|
|`event.where`|The Apex stack trace is referenced, if it is generated by the remote method.|

Apex primitive data types returned by `result`—such as strings or numbers—are converted to their JavaScript equivalents. Apex objects that are returned are converted to JavaScript objects, while collections are converted to a JavaScript array. Keep in mind that JavaScript is case-sensitive, so `id`, `Id`, and `ID` are considered different fields.

As part of a JavaScript remote call, if the Apex method response contains references to the same object., the object is not duplicated in the returned JavaScript object. Instead, the rendered JavaScript object contains a reference to the same object. An example is an Apex method which returns a list that contains the same object twice.

