> ## Documentation Index
> Fetch the complete documentation index at: https://docs.germainux.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find and Fix a Salesforce Release Regression from Your IDE with the GermainUX MCP Server

> Ask your coding assistant what a Salesforce release broke in production, find the Apex line behind it, fix it in your repo and confirm the fix, in one conversation.

Components
[`Engine`](https://docs.germainux.com/deploy/germain-ux-engine)

> [card] [What GermainUX Watches](#what-germainux-watches)
>
> Apex, errors, debug logs and deployments

> [card] [Find the Cause](#find-the-cause)
>
> From slow saves to the line of code

> [card] [Alert and Act](#alert-and-act)
>
> Catch the next one sooner

> [card] [Set It Up](#set-it-up)
>
> Salesforce, MCP Server and your IDE

## Overview

A release goes out in the morning. An hour later, sales reps say that saving an Opportunity takes ages, and some of them get an error on the pricing panel. The developer has the code open in their IDE, but not what production did: which saves slowed down, which exception was thrown, and on which line.

That evidence is spread across Salesforce. Event Monitoring log files, debug logs, the Setup Audit Trail and deployment history each sit on their own screen, and the developer has to download, open and compare them by hand. Meanwhile, the assistant in their IDE can read the code but has never seen production.

GermainUX collects all of it, from Apex executions and exceptions to debug logs and deployments. With the [GermainUX MCP Server](https://docs.germainux.com/integrations/mcp-server.md), the developer's coding assistant reads that data in the same conversation as the code. It finds the deployment that started the slowdown, reads the exception and its stack trace, confirms the cause in the debug logs and opens the line in the repo. It then proposes the fix and, after the hotfix, checks that production is back to normal.

Slow Saves
The Deployment
The Exception
The Debug Log
The Code Fix
Fix Confirmed

This page uses Salesforce Sales Cloud, Claude Code and an SFDX project as the example. The same approach works for any application GermainUX monitors down to the code, and any coding assistant that [connects to the MCP Server](https://docs.germainux.com/integrations/mcp-server/connect-an-ai-client.md), such as Cursor or GitHub Copilot in VS Code. When the question starts from one customer's complaint rather than a release, see [Complaint Investigation with MCP](https://docs.germainux.com/use-cases/complaint-to-ticket-analysis.md).

### Questions It Answers

* Did this morning's deployment slow down Opportunity saves, and by how much?
* What did the deployment change, and who deployed it?
* Which exception do users hit, and which line of Apex throws it?
* Is it our code, or Salesforce, the network or the pricing API?
* What's the fix, based on what production actually did?
* Is it fixed?

## What GermainUX Watches

The assistant answers from the same KPIs the Workspace shows. The Salesforce Engine monitors collect them through the Salesforce APIs, with nothing to install in the org.

| Signal | What it tells you | Where it comes from |
| - | - | - |
| **Apex executions** | Duration, CPU time and SOQL query count of every Apex request, with its entry point, such as the pricing controller | [Log Monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-log-monitoring.md) (**Salesforce Log Apex Execution**, **Salesforce Log Apex Trigger**) |
| **Exceptions and errors** | Unhandled Apex exceptions with their stack trace, and the errors users see in Lightning components | [Log Monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-log-monitoring.md) (**Salesforce Log Apex Unexpected Exception**, **Salesforce Log Lightning Error**) |
| **Debug logs** | Every SOQL query, DML statement and exception inside one traced execution | [Debug Log Monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-debug-log-monitoring.md) (**Salesforce Code SOQL Execution**, **Salesforce Code Exception**) |
| **Deployments and changes** | Each deployment with its components and tests, and each change in Setup, such as Apex class code | [Audit Monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-audit-monitoring.md) (**Deployment Run**, **Salesforce Setup Audit**) |
| **Callouts** | Response time and status of the org's calls to external APIs | [Log Monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-log-monitoring.md) (**Salesforce Log Apex Callout**) |
| **Salesforce's own health** | Incidents and maintenance on your Salesforce instance | [Instance Status Monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-instance-status-monitoring.md) |

See [Salesforce Monitoring KPIs](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-monitoring-kpis.md) for the full list.

## Find the Cause

The investigation runs in one conversation, in the IDE where the code is:

1. Ask what changed in production after the deployment. The assistant compares the slow saves with the same hours on the previous days and lines them up with the deployments and Setup changes.
2. Read the exception users hit and its stack trace, down to the class and line.
3. Confirm the cause in a debug log: what the execution did, query by query.
4. Rule out what stayed normal: other objects, external APIs and Salesforce itself.
5. Open the line in the repo and fix it, then ask again after the hotfix to confirm it worked.

See [Example Prompts](https://docs.germainux.com/integrations/mcp-server/example-prompts.md) for how the assistant uses the MCP tools, and [Available Tools](https://docs.germainux.com/integrations/mcp-server.md#available-tools) for the full list.

The example below comes from simulated data, and its numbers belong to the example. All times are in UTC.

### Example: A Release Puts a SOQL Query in a Loop

At 08:40 on Friday, Nov 13, a deployment changes `OpportunityPricingService`, its test class and `OpportunityTrigger`. Since that release, the service reads the pricebook entry of each line item with its own query. An Opportunity with many products now runs dozens of queries on every save, and the biggest ones hit Salesforce's limit of 100 queries per transaction. The developer reproduces it with a trace flag on their own user, then opens the SFDX project in VS Code and asks Claude Code.

**1. Ask what changed after the deployment**

Ask: *"Opportunity saves have been slow since this morning's release. Compare Apex executions on Nov 13 from 06:00 to 12:00 UTC with the same hours on the previous days, by entry point, and tell me which deployment or Setup change lines up with it. Stay within that window."*

The assistant queries **Salesforce Log Apex Execution** by entry point for both periods (`query_kpi`), then **Deployment Run** and **Salesforce Setup Audit** for the same morning. In this example, the slowdown comes from one entry point, `OpportunityPricingController.recalculate`. It takes 5.96 seconds on average and runs 54 SOQL queries per call, against 0.72 seconds and 4 queries on the previous days. The other entry points keep their usual times. Hour by hour, the slowdown starts at 09:00.

The match is the Salesforce deployment at 08:40, and the Setup Audit Trail records a changed Apex class and trigger at 08:44. The other releases that morning belong to other applications. Because the repo is open in the IDE, the assistant also names the commit that most likely went out with the deployment, `1b46bb0`, which replaced one bulk `PricebookEntry` query with one query per product.

![Claude Code answer: on Nov 13 from 06:00 to 12:00 UTC, OpportunityPricingController.recalculate went from 0.72 to 5.96 seconds and from 4 to 54 SOQL queries per call, about 8 times slower from 09:00, while RecordSaveController.save and CaseAssignmentHandler.assign didn't change. It lines up with the Salesforce deploy at 08:40 UTC and the Apex class and trigger changes at 08:44, the other releases are unrelated, and commit 1b46bb0 is the likely cause](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/regression-check.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=e1b3ddecdde315b58a3864854d151a40)

Slow Saves Since the Deployment - Claude Code

In the Workspace, deployments and Apex exceptions show as [markers](https://docs.germainux.com/analytics/kpis/kpi-relationships.md#marker) on the Apex executions. In this example, Opportunity saves average 6.0 seconds from 06:00 to 18:00, against 0.72 seconds at the same hours on the previous days. Execution times jump after the 08:40 deployment marker, exception markers bunch up between it and the hotfix marker in the afternoon, and execution times drop back after the hotfix.

![Analysis of Salesforce Log Apex Execution for the Opportunity pricing controller from 06:00 to 18:00 UTC on Nov 13: 6.011 seconds on average against 0.724 seconds on the previous days, and a Relationships chart from Nov 11 to Nov 15 with execution times and Apex exception markers high between the Nov 13 deployment markers](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/opportunity-saves-markers.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=c63a333d20b90d6f1ef6b50ccca0e41d)

Opportunity Saves Between the Deployment and the Hotfix - GermainUX

Hover the 08:40 marker to see the deployment's details: who ran it, its status, and the components it changed.

![Apex Execution analysis with the 08:40 UTC Deployment Run marker on Nov 13 hovered: a 312-second deploy of 3 components, status Succeeded, with the details listing OpportunityPricingService among the components](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/release-marker-details.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=0d1850b281581ed655686c68e0f3d72c)

Deployment Marker Details - GermainUX

**2. Read the exception**

Ask: *"Which exceptions did users hit on Opportunities in that window? Show the stack trace and how many users were affected."*

The assistant queries **Salesforce Log Apex Unexpected Exception** and **Salesforce Log Lightning Error** for the same window (`query_kpi`). In this example, `System.LimitException: Too many SOQL queries: 101` is thrown 6 times, for 4 users. Its stack trace runs from `OpportunityTrigger` line 12, through `OpportunityPricingService.recalculate` line 88, to `OpportunityPricingService.loadPrices` line 214. The assistant finds the users by matching each exception with the Lightning error a user saw at the same moment. When an Opportunity has enough line items to go past 100 queries, the whole save fails.

![Claude Code answer: System.LimitException Too many SOQL queries: 101, 6 times for 4 users on Nov 13 between 06:00 and 12:00 UTC, with the stack trace OpportunityPricingService.loadPrices line 214, recalculate line 88 and OpportunityTrigger line 12, a table of the users and times matched through Lightning errors, and two pricing callout timeouts in the same window](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/exception-stack.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=ec43cb984fb6a37bb56bf897c681ead1)

The Exception and Its Stack Trace - Claude Code

**3. Confirm it in the debug log**

Ask: *"The trace flag was on my user, [sam.okafor@acme.example](mailto:sam.okafor@acme.example), from 10:05 to 11:50 UTC on Nov 13. What do my debug logs show for the Opportunity saves?"*

The assistant queries the debug log KPIs, such as **Salesforce Code Execution**, **Salesforce Code SOQL Execution** and **Salesforce Code Exception**, for that user (`query_kpi`, `search_kpi_facts`). In this example, each of the 12 traced saves takes about 5 seconds, almost all of it in `OpportunityTrigger` on the before-update event. Each one runs 101 `PricebookEntry` queries, about 40 milliseconds apart, and ends in `System.LimitException`. Each query is fast. The save is slow, and then fails, because of how many there are. See [SOQL Execution](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-debug-log-monitoring.md#soql-execution) for what a debug log records.

![Claude Code answer: 12 debug logs between 10:05 and 11:40 UTC, each taking 4.5 to 5.1 seconds, almost all in OpportunityTrigger on the before-update event, each running 101 SELECT queries on PricebookEntry about 40 milliseconds apart and ending in System.LimitException, matching the per-product query in loadPrices from commit 1b46bb0](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/debug-log-soql.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=ae9718d72c22112084bfcd9c007d3912)

101 Queries per Save in the Debug Log - Claude Code

**4. Rule out the rest**

Ask: *"Before I change the code, is anything else behind it? Check the pricing API callouts, Salesforce's instance status and other deployments on Nov 13 up to 12:00 UTC."*

In this example, nothing else lines up with the slowdown. Calls to the pricing API average 0.34 seconds against 0.25 on the previous days, a small rise that started before the slowdown, and none fail (`query_kpi` on **Salesforce Log Apex Callout**). Each save makes at most one call, so the API accounts for well under a second of the 5 to 6 seconds. **Salesforce Instance Status** is OK at every check. The 08:40 deployment is the only Salesforce code change that morning. The cause is in the code it changed.

![Claude Code answer for Nov 13 up to 12:00 UTC: pricing API callouts at 0.34 seconds against 0.25 on earlier days with none failed, Salesforce instance status OK at every check, and the 08:40 Salesforce deploy as the only Salesforce code change, with the portal and Help Center releases on other systems](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/rule-out-the-rest.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=90935f08252389cbe6a79c15144218b7)

Nothing Else Lines Up - Claude Code

**5. Fix the code**

Ask: *"Open `loadPrices` in `OpportunityPricingService.cls` and fix it so a save runs one pricebook query, whatever the number of line items. Show me what the release changed first."*

The assistant shows what commit `1b46bb0` changed: it replaced one bulk `PricebookEntry` query with one query per product, and dropped the `IsActive = true` filter. The fix reads the prices of every product on the line items, across all the Opportunities in the save, in one query, and restores the filter. `recalculate` now calls it once, before the loop over the Opportunities. Prices still come from the pricebook at save time, which is what the release wanted:

```apex OpportunityPricingService.cls theme={null}
@TestVisible
private static Map<Id, Map<Id, PricebookEntry>> loadPrices(List<OpportunityLineItem> items) {
    // Collect every product and pricebook on the line items
    Set<Id> pricebookIds = new Set<Id>();
    Set<Id> productIds = new Set<Id>();
    for (OpportunityLineItem item : items) {
        if (item.Product2Id != null && item.Opportunity.Pricebook2Id != null) {
            productIds.add(item.Product2Id);
            pricebookIds.add(item.Opportunity.Pricebook2Id);
        }
    }
    Map<Id, Map<Id, PricebookEntry>> pricesByPricebook = new Map<Id, Map<Id, PricebookEntry>>();
    if (productIds.isEmpty()) {
        return pricesByPricebook;
    }
    // One query for all of them, grouped by pricebook, then product
    for (PricebookEntry entry : [SELECT Id, UnitPrice, Product2Id, Pricebook2Id FROM PricebookEntry
                                 WHERE Pricebook2Id IN :pricebookIds AND Product2Id IN :productIds
                                 AND IsActive = true]) {
        if (!pricesByPricebook.containsKey(entry.Pricebook2Id)) {
            pricesByPricebook.put(entry.Pricebook2Id, new Map<Id, PricebookEntry>());
        }
        pricesByPricebook.get(entry.Pricebook2Id).put(entry.Product2Id, entry);
    }
    return pricesByPricebook;
}
```

The assistant edits the code but doesn't compile or test it. Run the tests in a sandbox before you deploy the hotfix.

![Claude Code answer: what commit 1b46bb0 changed, the bulk PricebookEntry query replaced by one query per product without the IsActive filter, and the fix, loadPrices at OpportunityPricingService.cls line 209 running one query with Pricebook2Id IN and Product2Id IN and IsActive true, called once from recalculate at line 85](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/code-fix.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=8d064107704163bdb08879802b5027da)

The Fix, Based on What Production Did - Claude Code

**6. Confirm the fix**

After the hotfix is deployed at 14:40, ask: *"Are Opportunity saves back to normal since the 14:40 deployment? Any more limit exceptions?"*

In this example, Apex executions are back to about half a second from the hotfix on, no execution runs more than 7 queries, and no `LimitException` has been thrown since, up to the latest data on Nov 17. In the Workspace, the execution times drop at the hotfix marker on the chart above.

![Claude Code answer: saves back to normal after the 14:40 UTC deploy, with Apex executions at 0.2 to 0.57 seconds and at most 7 SOQL queries from Nov 13 afternoon to Nov 17, against 1.9 to 3.7 seconds and 26 to 34 queries during the incident, and no LimitException since](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/fix-check.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=ee6e672984f59b04ad9625dc14ea8367)

Saves Before and After the Hotfix - Claude Code

Hover the 14:40 marker to see that the hotfix changed only `OpportunityPricingService`. To hover a deployment marker that an exception marker covers, click **Salesforce Log Apex Unexpected Exception** in the chart legend to hide the exceptions.

![Apex Execution analysis with the 14:40 UTC Deployment Run marker on Nov 13 hovered and the exception markers hidden: a deploy of OpportunityPricingService only, status Succeeded, with the details listing one component](https://mintcdn.com/germain-ux/EcG-bHGMKXvr8rBS/images/main/salesforce-release-regression-analysis/hotfix-marker-details.png?fit=max\&auto=format\&n=EcG-bHGMKXvr8rBS\&q=85\&s=5d825c13532b8ed6cea2bb6197de56c6)

Hotfix Marker Details - GermainUX

The developer fixed the cause, not the symptom, without downloading a log file or leaving the IDE. To see the same slow save next to a normal one in the Workspace, see [Compare a Slow Save with a Normal One](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-engine-monitoring-deployment.md#example-compare-a-slow-save-with-a-normal-one).

## Alert and Act

Users noticed this release before the team did. To catch the next one sooner:

* **[SLAs](https://docs.germainux.com/analytics/slas.md)** and [outlier detection](https://docs.germainux.com/analytics/outlier-detection.md) on the duration of Apex executions, per entry point, so a release that slows one save raises an alert
* **[Alerts](https://docs.germainux.com/automation/notifications/create-an-alert.md)** on new Apex exceptions such as `System.LimitException`, by email, [Microsoft Teams](https://docs.germainux.com/automation/notifications/microsoft-teams-notification.md) or [Slack](https://docs.germainux.com/automation/notifications/slack.md)
* **[Alerts on Setup changes](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-audit-monitoring.md#configure-alerts)** for Apex code changed in production, so the team knows a release landed
* **A post-release check in your IDE:** right after each deployment, ask the assistant to compare the classes it changed with the same hours on the previous days

## Set It Up

Each step adds value on its own. The assistant can answer more questions the more of the org GermainUX monitors.

**1. Monitor the Salesforce org**

Run the Salesforce wizard to [deploy Salesforce Engine monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-engine-monitoring-deployment.md). It collects Event Monitoring logs, deployments, Setup changes, code and instance status. Event Monitoring data arrives about an hour after each hour ends, and deployments with the next Audit Monitor run. See [Collection Schedule and API Usage](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-engine-monitoring-deployment.md#collection-schedule-and-api-usage).

**2. Collect debug logs**

Set a trace flag in Salesforce on the user that reproduces the problem, then let [Debug Log Monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-debug-log-monitoring.md) collect the logs. GermainUX collects only the debug logs Salesforce generates.

**3. Show deployments on the timeline**

[Configure KPI relationships](https://docs.germainux.com/analytics/kpis/kpi-relationships.md#configuration) from **Salesforce Log Apex Execution** and your other Apex KPIs to **Deployment Run**, shown as [markers](https://docs.germainux.com/analytics/kpis/kpi-relationships.md#marker). Every chart of those KPIs then shows when a deployment landed.

**4. Enable the MCP Server for developers**

[Enable the MCP Server](https://docs.germainux.com/integrations/mcp-server/enable-the-mcp-server.md) and give the developers a GermainUX account with access to the org's data. Every tool call runs as the signed-in user, so developers see only what their account allows. See [What users can see and do](https://docs.germainux.com/integrations/mcp-server/enable-the-mcp-server.md#what-users-can-see-and-do).

**5. Connect the coding assistant**

[Connect the coding assistant](https://docs.germainux.com/integrations/mcp-server/connect-an-ai-client.md) the developers use, such as Claude Code, Cursor or GitHub Copilot in VS Code, to the GermainUX MCP Server. Open the SFDX project in the same IDE, so the assistant reads production data and the code side by side.

## Additional Resources

> [card] [MCP Server](https://docs.germainux.com/integrations/mcp-server.md)
>
> Connect AI assistants to GermainUX

> [card] [Salesforce Engine Monitoring](https://docs.germainux.com/integrations/salesforce-monitoring/salesforce-engine-monitoring-deployment.md)
>
> Deploy monitoring through the Salesforce APIs

> [card] [Use Cases](https://docs.germainux.com/use-cases/overview.md)
>
> More Use Cases

## Get Help

Every Salesforce team has its own release process, trace-flag habits and coding tools. The GermainUX team can help you deploy Salesforce Engine monitoring, bring your deployments onto the timeline, and set up the MCP Server for your developers.

> [card] [Contact GermainUX Support](https://docs.germainux.com/getting-started/support.md)
>
> The GermainUX team helps you get up and running faster, empower your team, turn data into actionable insights, and optimize performance to deliver measurable business outcomes.

> [card] Can't Find What You Need?
>
> Search all GermainUX docs with **Ctrl + K**, or use the feedback buttons at the bottom of this page to tell us what is missing.

The content of this document is proprietary to GERMAIN SOFTWARE.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.