Map what depends on what

Salesforce dependencies are spread across flows, Apex, formulas, layouts, permissions and sharing rules. Trace them in both directions, from one question, with each link named.

For architects and developers

Short answer

Ask your AI assistant “what depends on the Status field on Project?” or “what does PaymentService read and write?”. sf-intelligence follows the links in your org’s metadata in either direction and lists each one with how it was found: stated in the metadata, read from parsed source, or matched by a pattern you should double-check.

A real answer from the demo org

Two traces on Verdant, the demo org: everything that depends on one field, and everything one Apex class touches.

Question

“What depends on the Status field on Project?”

9 components across code, automation, layouts, sharing and analytics.

Next: Pick a new value or rename? Ask “what if I remove the Approved value from Project Status?”

Depends on it
  • Apex trigger → classProjectTrigger › ProjectTriggerHandlerApexClass:ProjectTriggerHandler

    Reads Status every time a Project is saved.

  • Apex batch classIncentiveBatchApexClass:IncentiveBatch

    Reads Status.

  • FlowProject On ApproveFlow:Project_On_Approve

    Starts when Status is Approved.

  • FlowInstallation On CompleteFlow:Installation_On_Complete

    Writes Status.

  • Validation ruleComplete Requires PermitValidationRule:Project__c.Complete_Requires_Permit

    Checks Status.

  • Formula fieldIs CompleteCustomField:Project__c.Is_Complete__c

    Calculated from Status.

  • Page layoutResidential LayoutLayout:Project__c.Residential Layout

    Shows the field.

  • Sharing ruleShare Projects To OpsSharingRule:Project__c.Share_Projects_To_Ops

    Uses Status in its criteria.

  • CRM AnalyticsProject PipelineWaveXmd:Project_Pipeline

    References the field.

The answer also lists the test class that writes Status and the profiles and permission set that grant access to it. Access isn’t usage, so they are kept apart from this list.

Every line says how it was found: stated in the metadata, or read from parsed Apex and formula source.

For developers: the tool call

Your assistant made this call to the sf-intelligence MCP server. sfi.get_impact isn’t in the short default tool list, so it runs through sfi.run_analysis:

{
  "name": "sfi.run_analysis",
  "arguments": {
    "name": "sfi.get_impact",
    "args": {
      "componentId": "CustomField:Project__c.Status__c"
    }
  }
}
Question

“What does the PaymentService class read and write?”

3 reads, 1 write all on Invoice.

Next: Ask “what tests should I run if I change PaymentService?” before you deploy.

Reads
  • FieldInvoice › AmountCustomField:Invoice__c.Amount__c
  • FieldInvoice › StatusCustomField:Invoice__c.Status__c
  • Roll-up summaryInvoice › Total PaidCustomField:Invoice__c.Total_Paid__c
Writes
  • FieldInvoice › StatusCustomField:Invoice__c.Status__c

Each field comes from the parsed Apex source. The class also queries Invoice and creates Payment records; those two were found by a pattern match, and the answer labels them that way so you know to check them.

Its only caller in the org is its own test class, PaymentServiceTest, and that is the one test to run after changing it.

For developers: the tool call

Your assistant made this call to the sf-intelligence MCP server. sfi.get_edges isn’t in the short default tool list, so it runs through sfi.run_analysis:

{
  "name": "sfi.run_analysis",
  "arguments": {
    "name": "sfi.get_edges",
    "args": {
      "componentId": "ApexClass:PaymentService",
      "direction": "outgoing"
    }
  }
}

Recorded with sf-intelligence 0.8.0 on the built-in demo org. The wording is ours; the facts are the tool’s. More real answers.

Two directions

What depends on this? tells you what to check before you change something. In the demo org, the Project Status field feeds a trigger handler, a batch class, two flows, a validation rule, a formula, a layout, a sharing rule and an analytics dataset. What does this depend on? tells you what a component needs. PaymentService reads three Invoice fields and writes one, which is why changing Invoice Status needs a look at that class first.

Ask it like this

Use your own object and field names. If a name matches more than one thing, it asks which one you mean.

  • What depends on the Status field on Project?
  • What does the PaymentService class read and write?
  • What calls this Apex method?
  • What does the Installation On Complete flow update?
  • What of mine depends on the managed package I want to uninstall?

What it checks, and what it can’t see

Checks

  • Fields and objects: formulas, roll-ups, flows, validation rules, layouts, sharing rules
  • Apex: the fields a class reads and writes, and who calls it, from parsed source
  • Flows: what starts them, what they read and what they change
  • Lightning and Aura components that call Apex, when your refresh pulled them
  • Packages: your components that reference a namespace

Can’t see

  • Calls made by a name built at run time, or through reflection
  • Code inside managed packages
  • Integrations calling in from outside Salesforce
  • Kinds of metadata your refresh didn’t pull. Each answer lists them
For developers: the tools behind this

Your assistant picks these from the plain-language question. You never have to name them.

Questions

What do “stated”, “parsed” and “pattern match” mean?

They say how a link was found. Stated means Salesforce’s metadata names the dependency directly. Parsed means it was read from Apex, flow or formula source. A pattern match is a weaker text match, so check it before you act on it.

Why does access show up separately?

A profile that can see a field doesn’t depend on it, and won’t break if it changes. Permission grants are listed on their own so they don’t inflate the list of things to fix.

Can it show a diagram?

Answers can include a Mermaid diagram of the dependency graph, which assistants such as Claude can render.