Sub topic 10
Direct Setup URLs and Opening Setup from the CLI
This chapter assumes you can already open Setup from the gear icon and use Quick Find. You should also have the Salesforce CLI (sf) installed and an org authorized with sf org login web. It covers how Setup page addresses are built, how to bookmark or share them, and how to open them from a terminal.
Why direct URLs are worth learning
Clicking through Setup is fine for a one-off task. Direct addresses are better for pages you use every day, for runbooks, and for documentation. A bookmark to the Account fields page saves several clicks each time. A link in a deployment checklist removes the question "where is that screen?". A script that opens five pages at once saves minutes at the start of every support session.
Setup in Lightning Experience is a set of pages under one URL pattern, so you can learn the pattern once and reuse it.
Anatomy of a Setup URL
Every Lightning Setup page address has the same parts:
https://<your-domain>/lightning/setup/<PageName>/home- The host is your org's domain (My Domain), so it differs for every org.
/lightning/setup/tells Lightning Experience to show a Setup page.<PageName>identifies the page, such asSetupOneHomeorManageUsers.- The last segment is usually
homefor a top-level page andviewfor a detail page.
These four paths are relative to your domain:
/lightning/setup/SetupOneHome/home
/lightning/setup/ObjectManager/home
/lightning/setup/ObjectManager/Account/FieldsAndRelationships/view
/lightning/setup/ManageUsers/homeThey open Setup Home, Object Manager, the Account object's Fields & Relationships page, and the Users page. Append any of them to your org's domain, for example https://yourcompany.lightning.force.com/lightning/setup/ManageUsers/home.
Object Manager URLs
Object Manager addresses carry two extra segments: the object's API name and the section you want.
/lightning/setup/ObjectManager/<ObjectApiName>/<Section>/viewThe API name for a standard object is its plain name (Account, Contact). For a custom object it ends in __c (Invoice__c). Common section names include:
| Section segment | Page it opens |
|---|---|
| `Details` | Object details and settings |
| `FieldsAndRelationships` | Fields & Relationships |
| `PageLayouts` | Page Layouts |
| `LightningPages` | Lightning Record Pages |
| `RecordTypes` | Record Types |
| `ValidationRules` | Validation Rules |
A custom object's fields page therefore looks like this:
/lightning/setup/ObjectManager/Invoice__c/FieldsAndRelationships/viewOne more address shape appears for individual records, such as a single field. Those URLs include a record ID, for example .../FieldsAndRelationships/00N.../view. IDs differ between orgs and between a sandbox and production, so do not put them in shared runbooks.
Finding the URL for any page
You will not remember page names for every Setup page, and Salesforce does not publish a complete list. The reliable method is to discover them:
- Open the page in Setup by any route, such as Quick Find.
- Read the address bar and copy the part after your domain.
- Save it in a bookmark or note.
A few other pages follow the same pattern. Treat the following as starting points and confirm them in your own org, because page names can change between releases.
| Page | Path |
|---|---|
| Debug Logs | `/lightning/setup/ApexDebugLogs/home` |
| Setup Audit Trail | `/lightning/setup/SecurityEvents/home` |
| Sandboxes | `/lightning/setup/DataManagementCreateTestInstance/home` |
Opening Setup from the CLI
The command sf org open launches your browser already logged in to an org. Without options it opens the default landing page. The --path option sends you straight to a page:
sf org open --path lightning/setup/SetupOneHome/homeThe path is relative to the org's domain, so you give only the part you would have appended to the host.
The most useful options are:
| Option | Effect |
|---|---|
| `--path`, `-p` | Page to open, relative to the org's domain |
| `--target-org`, `-o` | Org alias or username, instead of the default org |
| `--url-only`, `-r` | Print the URL and do not launch a browser |
| `--browser`, `-b` | Choose a browser: `chrome`, `firefox`, or `edge` |
| `--private` | Open in a private or incognito window |
Why the CLI is better than pasting a URL
A plain URL works only if you are already logged in to the right org in the current browser profile. If you work with several orgs, a pasted link often lands on a login screen or on the wrong org. sf org open uses the credentials the CLI already holds for the org you name, so you go straight in. The --private option keeps each org's session separate from your other tabs, which is handy when you must be in production and a sandbox at the same time.
sf org open --target-org my-sandbox --private \
--path lightning/setup/ObjectManager/Account/FieldsAndRelationships/viewHandling the URL-only output safely
With --url-only, the command prints a link instead of opening it:
sf org open --target-org my-sandbox --url-only \
--path lightning/setup/ManageUsers/homeA script for a recurring routine
If you start a task by opening the same set of pages, put the paths in a script. This one takes an org alias as its only argument and opens four pages:
#!/usr/bin/env bash
set -euo pipefail
org="${1:?Usage: open-setup.sh <org-alias>}"
paths=(
"lightning/setup/SetupOneHome/home"
"lightning/setup/ObjectManager/home"
"lightning/setup/ManageUsers/home"
"lightning/setup/ApexDebugLogs/home"
)
for path in "${paths[@]}"; do
sf org open --target-org "$org" --path "$path"
doneRun it as ./open-setup.sh my-sandbox. Each call opens a tab in your browser. If a path is wrong, Salesforce shows an error page or redirects to Setup Home. The script does not stop, so check the tabs rather than the exit code.
How the pieces connect
The last decision in the diagram matters. A direct URL does not bypass permissions. If your user lacks the permission to view Setup, or to view the specific area, the page will not load for you, however the link was reached.
Common errors
- The link lands on a login page. The browser has no session for that org. Use
sf org openor sign in first. - Right path, wrong org. Browsers reuse the last session for a domain family. Name the org with
--target-organd consider--private. - Object Manager shows "page not found". Check the API name. Custom objects need
__c, and the name is case-sensitive in practice. Copy it from the Object Manager list. - A saved URL stops working after a release or in another org. Page names can change, and record IDs always differ. Prefer paths without IDs and re-copy them when a link breaks.
- The CLI opens the wrong org. Without
--target-org,sf org openuses your default org. Check it withsf config get target-org. - A leading slash. The documented form is
lightning/setup/...with no leading slash. Use that form in scripts for consistency.
Choosing between the approaches
| Situation | Best approach |
|---|---|
| One-off task, unsure where the page is | Quick Find |
| Page you visit daily in one org | Browser bookmark |
| Same page across several orgs or sandboxes | `sf org open --target-org ... --path ...` |
| Runbook or documentation | Relative path, no domain, no IDs |
| Automating a routine | Shell script around `sf org open` |
Exercise
You are documenting a deployment checklist for a team that works in a production org and two sandboxes. One step says "Review the fields on the custom object Invoice__c." Write the command a teammate would run to open that page in a sandbox with the alias qa, and explain why you would put the path in the checklist instead of a full link copied from your browser.
Show answer
Command: sf org open --target-org qa --path lightning/setup/ObjectManager/Invoice__c/FieldsAndRelationships/view. The path works in every org because it has no domain and no record ID, and --target-org picks the sandbox. A copied browser link would contain your org's host, and it might not log the teammate in to the right org. If it came from --url-only, it would also contain a session token that gives access to your org.