Sub topic 2
Apps and the App Launcher
This chapter covers how Lightning apps are built from navigation items and how the App Launcher switches between them. It assumes you know basic Salesforce terms (object, record, field). It also assumes you can sign in to an org, such as a Developer Edition org, with a user who can view standard objects like Accounts and Contacts.
What a Lightning app is
A Lightning app is a named collection of navigation items. Each item points to something a user needs for a job: an object's home page, a custom page, a dashboard, or a utility. An app does not store data. It decides which doors appear in the navigation bar and how the workspace looks.
A sales rep and a support agent may use the same org and the same Account object. Each sees a different app, with items ordered for their work. That is the reason apps exist.
Each app has these main properties:
| Property | What it controls |
|---|---|
| Name and API name | The label users see, and the unique name used in code and URLs |
| Navigation style | Standard navigation (tabs in the bar) or console navigation (workspace tabs) |
| Navigation items | The objects and pages shown in the navigation bar |
| Branding | Logo, color, and the header |
| Utility bar | Optional tools along the bottom of the window, such as Notes or History |
| User profiles | Which profiles can see the app |
Chapters later in this tutorial cover the navigation bar, tabs, and console navigation in detail. Here the focus is the app as a container and the way you move between apps.
Standard apps and custom apps
Salesforce ships standard apps, and the exact set depends on your edition and licenses. Common ones are Sales, Service, and Marketing. Administrators can also build custom apps in Setup, under App Manager.
Whether an app is standard or custom, it appears in the same places and behaves the same way for users. The difference matters to administrators. Standard apps are managed by Salesforce, and you can edit only some of their settings. Custom apps are fully under your control.
The app switcher and the current app
The current app name appears at the left of the header, next to the App Launcher icon (a grid of nine dots). The name sits above the navigation bar. Everything in the bar belongs to that app.
Your current app is remembered. When you sign in again, Salesforce returns you to the last app you used. An administrator can also set a default app for a profile, which applies when you have not chosen one yet.
Two points often cause confusion:
- The same object can appear in many apps. Accounts is in Sales and Service, for example. The records are identical in each app. Only the surrounding navigation differs.
- An object missing from your current app is not missing from the org. It may simply be in another app, or it may not have a tab in any app you can see.
The App Launcher
The App Launcher is the full-screen picker opened with the nine-dot icon. It has three jobs:
- Switch to another app.
- Open any navigation item you have access to, including items that are not in the current app.
- Search apps and items by name.
The launcher shows two sections. Apps lists the apps your profile or permission sets allow you to use. Items lists the tabs and pages you can open, such as objects, custom tabs, and dashboards. A View All link expands the lists. A search box at the top filters both sections as you type.
The diagram shows how a user moves through the launcher.
Opening an item from the launcher
Selecting an entry under Items opens that object or page. The current app does not change. If you open Cases from the launcher while in an app that has no Cases tab, the page loads, but the navigation bar shows no highlighted Cases entry. The bar still belongs to the original app. This is a common source of "where am I?" confusion. If you want the navigation that suits the work, switch to the app that contains the item.
Why you may not see an app or item
Visibility rules cause most questions about the launcher. The list is filtered by several layers of access.
| Reason | Where it is set | Effect |
|---|---|---|
| App not assigned to your profile or permission set | App settings, User Profiles; or permission set assignments | The app is absent from Apps |
| No tab visibility for the object | Profile or permission set, tab settings | The object is absent from Items |
| No object permission | Profile or permission set, object settings | The tab may show, but records cannot be read |
| Item is hidden by default | Tab setting "Default Off" | The tab exists but appears only when you personalize or add it |
Tab visibility and object permission are separate. A user can have Read access to Accounts and still have the Accounts tab set to hidden. The user can then reach Accounts through a link or search, but not through a tab. When you debug a missing item, check tab visibility first and object permissions second.
How the launcher relates to the navigation bar
The launcher and the navigation bar answer different questions:
- The navigation bar shows what the current app's designer chose to put in front of you.
- The launcher shows everything you are allowed to open.
You can think of the bar as a short list of favorites chosen by the administrator, and the launcher as the full directory. Users can customize the bar for themselves in many apps, which a later chapter covers. Changes you make there do not alter the app for other users.
Building a simple custom app (administrator view)
You do not need to build apps to use them, but seeing the steps shows how the parts fit together. An administrator creates an app with these steps:
- Open Setup and search for App Manager.
- Select New Lightning App.
- Enter an app name, choose the navigation style, and set branding.
- Optionally add utility bar items.
- Pick the navigation items, such as Accounts, Contacts, and a dashboard.
- Choose which user profiles can access the app.
- Save and test as a user with one of those profiles.
Step 7 matters. An administrator usually has broad access and sees everything in the launcher. A normal user may see far less. Test with a representative user, or use the Login As feature when your org allows it.
Apps in URLs and code
The current app is not part of a record URL. The page for one Account has the same address in every app, as the Lightning URL patterns chapter shows. The app is stored as a user preference instead.
Developers who need to point a user to an app can use the standard__app page reference type with NavigationMixin. The sketch below opens an app by its API name. The value standard__LightningSales is used for the Sales app in many orgs. Check the API name of your own app in App Manager before relying on it.
import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
export default class AppSwitcherButton extends NavigationMixin(LightningElement) {
openSalesApp() {
this[NavigationMixin.Navigate]({
type: 'standard__app',
attributes: {
appTarget: 'standard__LightningSales'
}
});
}
}This component works only inside Lightning Experience, and the user must be allowed to use the target app. If not, the navigation fails or lands on the default page.
Common errors
- Searching for an object in the wrong place. If a tab is not in the bar, use the launcher's Items list or global search before assuming you lack access.
- Assuming a change to one app affects all apps. Navigation items belong to each app separately. Adding Contacts to Sales does not add it to Service.
- Confusing app access with object access. App assignment controls whether you see the app. Object permissions control what you can do with the data.
- Expecting the launcher to switch apps for items. Items open in the current app, as described above.
- Testing only as an administrator. Your own view hides visibility problems that other users hit.
Exercise
A user opens the App Launcher and picks Cases under Items while working in the Sales app. The Sales app has no Cases tab. Which app is now current, and what do you check if a colleague with the same profile cannot find Cases in the launcher at all?
Show answer
Sales is still the current app, because opening an item does not switch apps. For the colleague, check tab visibility for Cases on their profile or permission sets first, then their Read permission on the Case object. Tab visibility and object permission are separate settings.
Exercise
You added the Contacts tab to the Sales app. A service agent says Contacts is still missing from the Service app's navigation bar. Why, and where would an administrator fix it?
Show answer
Navigation items are set per app. Adding Contacts to Sales does not change Service. The administrator opens App Manager, edits the Service app, and adds Contacts under Navigation Items. The agent can also open Contacts from the App Launcher meanwhile.