---
schema_version: "1"
id: 6c9dd20a0d77e13e8e67349a369e738b0315dc227b9b5f64f250f2ce35d18034
title: Apex
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/262-0-0/rn_apex.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_apex.htm&release=262.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 8c8c95b93804c7b72e184e2af6898b2c5bed53e4b80d8bd6d4a8dfd725dedfa7
description: Database operations now run in user mode by default, not system mode. Further, database operations enforce the current user’s object-, field-, and record-level security settings by default. SOQL queries no longer support the WITH SECURITY_ENFORCED clause. Write integration Apex tests that can make callouts to Agentforce and Data 360. Enqueue Queueable and future method jobs up to a new elastic limit. Prepare for the Block Apex Anonymous Code Execution from Managed Packages release update. Declare multiline strings and use an improved string interpolation method.
products:
  - Cross Cloud
release: "262"
---
# Apex

Database operations now run in user mode by default, not system mode. Further, database operations enforce the current user’s object-, field-, and record-level security settings by default. SOQL queries no longer support the `WITH SECURITY_ENFORCED` clause. Write integration Apex tests that can make callouts to Agentforce and Data 360. Enqueue Queueable and future method jobs up to a new elastic limit. Prepare for the Block Apex Anonymous Code Execution from Managed Packages release update. Declare multiline strings and use an improved string interpolation method.

For more information on these enhancements, see the [Apex Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/) and the [Apex Reference Guide](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/).

- **[Database Operations Run in User Mode by Default, Not System Mode](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_default_user_mode.htm&release=262.0.0&type=5)**  
    Take advantage of an enhanced Apex security model that protects your data though default object- and field-level access enforcement. Apex database operations, such as SOSL and SOQL queries, DML statements, and Database methods, now run in user mode by default. In user mode, database operations enforce the sharing rules, field-level security, and object permissions of the current user. In earlier API versions, database operations default to system mode, which means that the current user can access all data regardless of their permissions.
- **[Apex Classes Enforce Sharing Rules by Default](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_default_enforce_sharing.htm&release=262.0.0&type=5)**  
    Take advantage of an enhanced Apex security model that protects your data through default record access enforcement. Apex classes without an explicit sharing declaration now default to `with sharing` mode, which enforces org-wide sharing settings and custom sharing rules. In earlier API versions, Apex classes without an explicit sharing declaration default to `without sharing` mode, with some exceptions. The `without sharing` mode bypasses sharing rules and allows the current user to access all records.
- **[The WITH SECURITY\_ENFORCED SOQL Clause is Removed](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_removed_withSecurityEnforced.htm&release=262.0.0&type=5)**   
    To run a SOQL or SOSL query in user mode, use the `WITH USER_MODE` clause instead of the `WITH SECURITY_ENFORCED` clause. Apex classes set to API version 67.0 and later that include `WITH SECURITY_ENFORCED` don’t compile.
- **[Apex Triggers Always Run in a “without sharing” Context](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_triggers_system_mode.htm&release=262.0.0&type=5)**  
    Apex triggers now always run in a `without sharing` context. Previously, nested triggers enforced sharing rules in certain edge cases. However, in API version 67.0 and later, database operations within trigger bodies, including SOQL queries, SOSL queries, DML statements, and Database methods, run in user mode unless system mode is explicitly specified. User mode overrides the trigger’s `without sharing` context and effectively enforces a `with sharing` context in the trigger body.
- **[Write Integration Tests for Agentforce and Data 360 in Apex (Developer Preview)](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_integrations_testing.htm&release=262.0.0&type=5)**  
    Write end-to-end Apex tests that make callouts to Agentforce and Data 360. Integration tests relax callout restrictions and transaction rollback semantics, so you can validate real service interactions and assert on actual side effects in your scratch org, without mock callouts.
- **[Avoid Workflow Disruptions by Enabling Elastic Limits for Asynchronous Jobs (Beta)](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_elastic_async_limit.htm&release=262.0.0&type=5)**  
    Prevent abrupt execution failures and limit exceptions if your org exceeds its daily asynchronous job limit. You can now enqueue Queueable and future method jobs up to a new elastic limit, which is twice the size of your org’s licensed daily limit. Asynchronous jobs that surpass the licensed daily limit are processed at a throttled rate.
- **[Block Apex Anonymous Code Execution from Managed Packages (Release Update)](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_block_exec_anon_ru.htm&release=262.0.0&type=5)**  
    To strengthen subscriber org security, block managed package session IDs from authenticating anonymous Apex code. If you enable this update, installed managed packages can no longer use `UserInfo.getSessionId()` to obtain a session ID and then use the session ID to execute anonymous Apex.
- **[Write Cleaner Code by Using Multiline Strings](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_multiline_string.htm&release=262.0.0&type=5)**  
    Declare Apex strings that span multiple lines without using repeated string concatenation. To interpolate values into regular and multiline strings, use the new `String.template()` instance method instead of the existing `String.format()` static method. These features make your Apex code easier to write, read, and maintain, especially when you construct HTTP payloads and other large text blocks.
- **[Work with Apex Code in Web Console (Beta)](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_webconsole.htm&release=262.0.0&type=5)**  
    Build, debug, and deploy Apex in Web Console, a client-side IDE embedded directly in Salesforce. Web Console offers a modern developer experience where you can build SOQL queries, configure trace flags and debug log levels, and execute anonymous Apex. Web Console also opens automatically when you access Apex items via the Apex Classes, Apex Triggers, or Apex Jobs pages in Setup, so you can implement modifications without disrupting your workflow.
- **[Get Key Apex Metrics in Setup with Agentforce (Beta)](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_agentic_setup.htm&release=262.0.0&type=5)**  
    The updated Org Health and Usage dashboard now provides Apex metrics in Agent for Setup. The dashboard shows Apex classes on outdated API versions, Apex compilation errors, and current asynchronous Apex job usage.
- **[Use Visualforce PDF Rendering Service with Apex Blob.toPdf() (Release Update)](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_system_blob_topdf.htm&release=262.0.0&type=5)**  
    With this update enabled, the Apex `Blob.toPdf()` method for PDF rendering uses the same rendering service as Visualforce. The Visualforce PDF rendering service offers improvements such as additional fonts and multibyte character support. This change makes PDF rendering more consistent on the Salesforce Platform.
- **[Customize Apex Action Configuration in Flow Builder](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_invocableactionextension_metadata_enhancements.htm&release=262.0.0&type=5)**  
    InvocableActionExtension metadata enhancements give you more tools to improve users' configuration experience and reduce input errors in Flow Builder. You can now define picklist values, assign metadata types, and add custom property editors for specified input parameters. You can also add custom headers to the standard property editor.
- **[Provide Visible No-Argument Constructors for Custom Apex Classes Used as Invocable Action Parameters](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_constructor_visibility_invocable_custom_classes_v66.htm&release=262.0.0&type=5)**  
    Apex classes used for invocable action parameters must have a visible no-argument constructor. The constructor must be global for packaged classes invoked from outside the package. Use API version 65.0 or earlier with the release update disabled to maintain the previous behavior.

#### See Also

- [Apex: New and Changed Items](https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_nc.htm&release=262.0.0&type=5 "These classes, enums, and interfaces are new or have changes.")