Apex: New and Changed Classes and Interfaces

These classes and interfaces are new or have changes.

New Apex Classes

These classes are new in this release.
Auth Namespace
VerificationResult Class
Stores the result of the System.UserManagement.verifySelfRegistration method. The method returns the result of a verification challenge that you invoke when you create your own Verify page. It contains the verification status and session ID if the user is created successfully.
System Namespace
OrgLimit Class
The System.OrgLimit class contains methods that return the name, current value, and maximum limit for an instance.
getName()
Returns the limit’s name.
getValue()
Returns the limit usage value.
getLimit()
Returns the maximum allowed limit value.
OrgLimits Class
The System.OrgLimits class contains methods that return a list of all org limits or a map of all org limit names and values.
getAll()
Returns a list of OrgLimit instances.
getMap()
Returns a map of all OrgLimit instances with the limit name as key.

Changed Apex Classes

These existing classes have new or changed methods or constants.
AppLauncher.LoginFormController Class
New Method
loginGetPageRefUrl(username, password, startUrl)
Logs in the user using the specified username and password. If login is successful in a Lightning environment, the user is redirected to the page specified in the startUrl. In a non-Lightning environment, use the startUrl returned by the method to program a redirect. If login fails, an error string is returned.
Auth.AuthConfiguration Class
New Methods
getCertificateLoginEnabled(domainUrl)
Returns true if certificate-based authentication is enabled for the My Domain URL.
getCertificateLoginUrl(domainUrl, startUrl)
Returns the certificate-based authentication endpoint for the My Domain URL if the org has certificate-based authentication enabled.
Auth.SessionManagement Class
New Method
finishLoginDiscovery(method, userId)
Finish the My Domain Login Discovery login process.
System.SObject Class
New Methods
isSet(fieldName)
Returns information about the queried sObject field. Returns true if the sObject field is populated, either by direct assignment or by inclusion in a SOQL query. Returns false if the sObject field is not set. If an invalid field is specified, an SObjectException is thrown.
isSet(field)
Returns information about the queried sObject field. Returns true if the sObject field is populated, either by direct assignment or by inclusion in a SOQL query. Returns false if the sObject field is not set. If an invalid field is specified, an SObjectException is thrown.
System.String Class
Changed Method
format(stringToFormat, formattingArguments)
The formattingArguments parameter type now uses List<Object> instead of List<String> to allow non-string objects as parameters. Treat the first argument as a pattern and return a string using the second argument for substitution and formatting. The substitution and formatting are the same as apex:outputText and the Java MessageFormat class. Non-string types in the second argument’s List are implicitly converted to strings, respecting the toString() method overrides that exist on the type.
System.UserManagement Class
New Methods
initSelfRegistration(method, user)
Use this method to invoke a verification challenge when creating your own Verify page for community self-registration.
sendAsyncEmailConfirmation(userId, emailTemplateId, networkId, startUrl)
Send an email message to a user’s email address for verification. The message contains a verification link (URL) that the user clicks to verify the email address later on. You can send email verifications in bulk.
verifySelfRegistration(method, identifier, code, startUrl)
Use this method to complete a verification challenge when creating your own Verify page for community self-registration. If the person who is attempting to register enters the verification code successfully, the user is created and logged in.

New Apex Enum

This enumeration was introduced in this release.
Auth.LoginDiscoveryMethod Enum
Contains the method used to verify the user’s identity.

New Apex Exception

This exception was introduced in this release.
Auth Namespace
DiscoveryCustomErrorException
Throw this exception to customize error messages that appear in MyDomainLoginDiscoveryHandler, LoginDiscoveryHandler, and ConfigurableSelfRegHandler.

New Apex Interface

This interface was introduced in this release.
Auth.MyDomainLoginDiscoveryHandler Interface
The handler used to implement the My Domain Login Discovery page, which is an interview-based (two-step) login process. First the user is prompted for a unique identifier such as an email address or phone number. Then the handler determines (discovers) how to authenticate the user. Either the user enters a password or is directed to an identity provider’s login page.
login(identifier, startUrl, requestAttributes)
Log in a Salesforce user given the specified unique identifier, such as email or phone number. If successful, redirect the user to the page specified by the start URL.