---
title: Avoid Directly Accessing Trigger.old And Trigger.new
description: "Impact Area Manageability Severity Medium Affected Element Apex Trigger ## Rule ID **SF-0038** ## Impact This can lead to hard to debug issues if the trigger Map has been modified. ### Time to fix 60 min ## Remediation Triggers should…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/pmd-rules/avoid-directly-accessing-trigger-old-and-trigger-new/"
updated: "2025-03-21"
category: PMD Rules
---

# Avoid Directly Accessing Trigger.old And Trigger.new

Impact Area

Manageability

           Severity

Medium

           Affected Element

Apex Trigger

## Rule ID

**SF-0038**

## Impact

This can lead to hard to debug issues if the trigger Map has been modified.

### Time to fix

60 min

## Remediation

Triggers should be bulkified and iterate through the map to handle the actions for each item separately.
