getAppViewInfo() for Lightning Experience

Returns information about the current application view. This method is available in API version 38.0 or later.

NameTypeDescription
callbackfunctionJavaScript method executed when the API method call is completed.

This method is asynchronous. The response is returned in an object passed to a callback method.

When you switch from a record detail page to a list view, this method returns:

  • In Lightning Experience, only the url

  • In Lightning Experience console apps, nothing is returned because the listener isn’t invoked

  • success (boolean)

    • : Returns true if the API method call was invoked successfully, false otherwise.

  • returnValue (object)

    • : Returns the URL of the current application view and includes any applicable record ID, record name, and object type. For example:

      Invoking this API method on a person account object returns the following additional information.

      • accountId or contactId—The associated account or contact ID.
      • personAccount—Which is true if person accounts are enabled in your org, false otherwise.

      For example:

      Since the URL structure of the returnValue can change in the future, we recommend that you don’t build any logic based on it.

  • error (array)

    • : If the API call was successful, this variable is null. If the API call failed, this variable returns an array of error messages.