Apex: New and Changed Classes and Interfaces

These classes and interfaces are new or have changed.

New Apex Classes

These classes were introduced in this release.
Formula Class in the System Namespace
The new System.Formula class contains the recalculateFormulas method that updates (recalculates) all formula fields on the input sObjects.
FormulaRecalcFieldError Class in the System Namespace
The new System.FormulaRecalcFieldError class is the return type of the FormulaRecalcResult.getErrors method. It contains methods that retrieve the name of the error field and a message describing why the formula calculation failed.
FormulaRecalcResult Class in the System Namespace
The new System.FormulaRecalcResult class is the return type of the Formula.recalculateFormulas method. It contains methods that return the sObject with formulas recalculated and errors encountered while recalculating formulas on the sObject.
Packaging Class in the System Namespace
The new System.Packaging class contains the getCurrentPackageId method that retrieves the packageID when the method is called in the context of an installed package.

Changed Apex Classes

These existing classes have new or changed methods or constants.
Auth.SessionManagement Class
New Methods
verifyDeviceFlow(userCode, startUrl)
Verifies the user code entered during the device authentication flow and redirects users to the OAuth approval page. If users aren’t logged in, they must log in. After successful login, users are prompted to allow the device to access Salesforce data.
EventBus.ChangeEventHeader Class
New Property
changedfields
A list of the fields that were changed in an update operation, including the LastModifiedDate system field. This field is empty for other operations, including record creation.
System.Type Class
New Methods
isAssignableFrom(sourceType)
Checks whether an object of one type can be assigned from an object of another type without instantiating either object. Returns true if the two types are compatible.
System.UserManagement Class
New Methods
initRegisterVerificationMethod(method)
Invokes a verification challenge for registering identity verification methods with a custom (Visualforce) page. Users can register either their email address or phone number.
verifyRegisterVerificationMethod(code, method)
Completes registering a user’s email address or phone number as a verification method when customizing the identity verification process.
System.UserInfo Class
New Methods
isCurrentUserLicensedForPackage(packageID)
Returns true if the context user has a license to the managed package. Otherwise, returns false

New Apex Interfaces

These interfaces were introduced in this release.
TxnSecurity.EventCondition Interface
Allows an implementing class to specify whether to take action when certain events occur based on a transaction security policy. This interface is part of Real-Time Event Monitoring and was beta in Summer ’19.
TxnSecurity.AsyncCondition Interface
Allows an implementing class to make asynchronous Apex calls. This interface is part of Real-Time Event Monitoring.