Sub topic 10
Direct Setup URLs and Opening Setup from the CLI
This chapter assumes you can open Setup from the gear icon, use Quick Find, and have the Salesforce CLI (sf) installed and authorized to an org. Clicking through menus works, but a direct URL gets you to a page in one step. You can bookmark it, share it with a teammate, or script it.
How Lightning Setup URLs are built
In Lightning Experience, every Setup page has a path that you add to your org's domain. Your org's domain looks like https://yourcompany.lightning.force.com. The paths below open the pages you will use most often.
/lightning/setup/SetupOneHome/home
/lightning/setup/ObjectManager/home
/lightning/setup/ObjectManager/Account/FieldsAndRelationships/view
/lightning/setup/ManageUsers/homeEach path has the same parts:
| Part | Example | Meaning |
|---|---|---|
| Prefix | `/lightning/setup/` | Tells Salesforce this is a Setup page in Lightning Experience |
| Page name | `SetupOneHome`, `ObjectManager`, `ManageUsers` | The Setup page or tool |
| Sub-path | `Account/FieldsAndRelationships` | A record or section inside the page, such as an object and one of its areas |
| View | `home` or `view` | The page state to display |
The Object Manager path shows the pattern for object pages. After ObjectManager/ comes the object's API name (Account), then the area (FieldsAndRelationships), then view. For a custom object, use the API name, which ends in __c, for example Invoice__c.
Finding the path for any page
You rarely need to memorize paths. Open the page you want through Quick Find, then read the address bar. Copy everything after the domain. This works for pages that have no obvious pattern.
Two habits help:
- Bookmark the pages you visit daily, such as the Flows list or a specific object's fields.
- Save paths in a team runbook without the domain, so the same path works in every org and sandbox.
Opening Setup from the CLI
The sf org open command opens an org in your default browser. It logs you in with the stored authorization, so you do not type a password. The --path option sends you straight to a page.
sf org open --path lightning/setup/SetupOneHome/homeThis opens your default org on Setup Home. To target another org, add --target-org with its alias or username. To open the Object Manager page for a custom object:
sf org open --target-org my-sandbox --path lightning/setup/ObjectManager/Invoice__c/FieldsAndRelationships/viewNotice that the CLI path has no leading slash. It is the same path as the browser URL, without the opening /.
Common errors
- "Page not found" or a blank Setup frame. The page name or object API name is misspelled. Paths are case-sensitive, so
Objectmanagerfails whereObjectManagerworks. - Using the label instead of the API name. Use
Invoice__c, not "Invoice". - Missing permission. If you lack access to Setup or to that page, Salesforce shows an insufficient privileges message. See the permissions chapter.
- Opening the wrong org. Without
--target-org, the CLI uses your default org. Runsf org listto confirm which org is the default before changing configuration. - Classic paths. Old links that look like
/setup/...belong to Salesforce Classic and may redirect or fail in Lightning.
Reviewing changes with a query
Direct access is also useful when you investigate what changed. The Setup Audit Trail is covered in its own chapter. Here, note that you can query it, which fits scripted workflows. This query returns the 20 most recent entries. Run it in the Developer Console Query Editor or with sf data query.
SELECT Action, Section, Display, CreatedDate, CreatedBy.Name
FROM SetupAuditTrail
ORDER BY CreatedDate DESC
LIMIT 20Exercise
You copied the path /lightning/setup/ObjectManager/Account/FieldsAndRelationships/view. Write the CLI command that opens the Account fields page in an org with the alias "dev-sandbox". Then name one reason the same command might fail in another org.
Show answer
sf org open --target-org dev-sandbox --path lightning/setup/ObjectManager/Account/FieldsAndRelationships/view. It might fail if the user lacks Setup permissions, if the alias is not authorized on this machine, or if the object has a different API name in that org.
Exercise
Why should a saved Setup path that contains a record ID not be shared across orgs?
Show answer
Record IDs are unique to each org. The same ID in another org points to a different record or to nothing, so the page will not load as expected.