Newer Version Available
Manage Favorites
Favorites let users access frequently used pages in Salesforce. Use
User Interface API Favorites resources to manage favorites.
You can create, get, delete, and update favorites, update all favorites at once, and update favorite usage information, for example, the number of times a favorite was clicked. Responses return all fields required to render favorites.
This request returns all the favorites of the context user.
Adding a favorite to the top of the list is as easy as knowing what type of favorite it is
and how to identify it. For example, to add an Account as a favorite, add it as a Record
favorite using its ID. To insert it at the beginning of the list, explicitly set the sortOrder to 1, otherwise
it’s inserted at the end of the
list.
To track how often a user accesses a particular favorite, make a patch request using the
favorite's ID and see the accessCount increment and the
lastAccessDate
update.
Removing a favorite is as easy and requires using the favorite's ID again.
To reorder or rename your favorites, you have some options. The first option is to
individually update each favorite one by one. When reordering this way, the server
automatically updates the sort order of affected favorites in the list so the sort order stays
consistent. The second and more useful option is to reorder, rename, and delete favorites in a
single request. This option is useful for building an edit dialog where the user can rename
some favorites, delete others, and reorder whichever they choose. All these changes can then
be made in a single
request.
Here’s the input for the PUT request:
Here’s the response for the PUT
request:
In
this single request, we deleted our contact John Doe, moved Leads to Follow Up to the top of
the list, and we renamed My Best Opportunities to Top Opportunities.