New and Changed Apex Classes, Enumerations, Exceptions, and Interfaces

These classes, methods, constants, enumerations, exceptions, and interfaces are new or have changed.

New Apex Classes

These classes were introduced in this release.
Classes in the Auth Namespace
AuthProviderCallbackState Class
The new Auth.AuthProviderCallbackState class provides request HTTP headers, body, and query parameters for user authentication to the Auth.AuthProviderPlugin.handleCallback method. This class allows you to group the information to be passed in rather than passing headers, body, and query parameters individually.
AuthProviderTokenResponse Class
The new Auth.AuthProviderTokenResponse class stores the response from the Auth.AuthProviderPlugin.handleCallback method.
Classes in the Reports Namespace
BucketField Class
The new Reports.BucketField class contains methods that describe a bucket field in a report.
getBucketType()
Returns the bucket type.
getDevloperName()
Returns the bucket’s API name.
getLabel()
Returns the user-facing name of the bucket.
getNullTreatedAsZero()
Returns true if null values are converted to the number zero, otherwise returns false.
getOtherBucketLabel()
Returns the name of fields grouped as Other in buckets of type PICKLIST.
getSourceColumnName()
Returns the API name of the bucketed field.
getValues()
Returns the report values grouped by the bucket field.
setBucketType(value)
Sets the BucketType of the bucket.
setBucketType(bucketType)
Sets the BucketType of the bucket.
setDevloperName(devloperName)
Sets the API name of the bucket.
setLabel(label)
Sets the user-facing name of the bucket.
setNullTreatedAsZero(nullTreatedAsZero)
Specifies whether null values in the bucket are converted to zero (true) or not (false).
setOtherBucketLabel(otherBucketLabel)
Sets the name of the fields grouped as Other (in buckets of BucketType PICKLIST).
setSourceColumnName(sourceColumnName)
Specifies the name of the bucketed field.
setValues(values)
Specifies which type of values are included in the bucket.
toString()
Returns a string.
BucketFieldValue Class
The new Reports.BucketFieldValue class contains information about “bucketed” values in a bucket field.
getLabel()
Returns the user-facing name of the bucket category.
getRangeUpperBound()
Returns the greatest range limit under which values are included in this bucket category (in buckets of type NUMBER).
getSourceDimensionValues()
Returns a list of the values from the source field included in this bucket category (in buckets of type PICKLIST and buckets of type TEXT).
setLabel(label)
Set the user-facing name of the bucket category.
setRangeUpperBound(rangeUpperBound)
Sets the greatest limit of a range under which values are included in this bucket category (in buckets of type NUMBER).
setSourceDimensionValues(sourceDimensionValues)
Specifies the values from the source field included in this bucket category (in buckets of type PICKLIST and buckets of type TEXT).
toString()
Returns a string.
CrossFilter Class
The new Reports.CrossFilter class contains information about a cross filter.
getCriteria()
Returns information about how to filter the relatedEntity. Describes the subset of the relatedEntity which the primary entity is evaluated against.
getIncludesObject()
Returns true if primary object has a relationship with the relatedEntity, otherwise returns false.
getPrimaryEntityField()
Returns the name of the object on which the cross filter is evaluated.
getRelatedEntity()
Returns name of the object that the primaryEntityField is evaluated against—the right-hand side of the cross filter.
getRelatedEntityJoinField()
Returns the name of the field used to join the primaryEntityField and relatedEntity.
setCriteria(criteria)
Specifis how to filter the relatedEntity. Relates the primary entity with a subset of the relatedEntity.
setIncludesObject(includesObject)
Specifies whether objects returned have a relationship with the relatedEntity (true) or not (false).
setPrimaryEntityField(primaryEntityField)
Specifies the name of the object on which the cross filter is evaluated.
setRelatedEntity(relatedEntity)
Specifies the name of the object that the primaryEntityField is evaluated against—the right-hand side of the cross filter.
setRelatedEntityJoinField(relatedEntityJoinField)
Specifies the name of the field used to join the primaryEntityField and relatedEntity.
toString()
Returns a string.
ReportCsf Class
The new Reports.ReportCsf class contains information about a custom summary formula.
getAcrossGroup()
Returns the name of a column grouping when the acrossGroupType is CUSTOM. Otherwise, returns null.
getAcrossGroupType()
Returns where to display the aggregate.
getDecimalPlaces()
Returns the number of decimal places that numbers in the custom summary formula have.
getDescription()
Returns the user-facing description of a custom summary formula.
getDownGroup()
Returns the name of a row grouping when the downGroupType is CUSTOM. Otherwise, returns null.
getDownGroupType()
Returns where to display the aggregate of the custom summary formula.
getFormula()
Returns the operations performed on values in the custom summary formula.
getFormulaType()
Returns the formula type.
getLabel()
Returns the user-facing name of the custom summary formula.
setAcrossGroup(acrossGroup)
Specifies the column for the across grouping.
setAcrossGroupType(value)
Sets where to display the aggregate.
setAcrossGroupType(acrossGroupType)
Sets where to display the aggregate.
setDecimalPlaces(decimalPlaces)
Sets the number of decimal places in numbers.
setDescription(description)
Sets the user-facing description of the custom summary formula.
setDownGroup(downGroup)
Sets the name of a row grouping when the downGroupType is CUSTOM.
setDownGroupType(value)
Sets where to display the aggregate.
setDownGroupType(downGroupType)
Sets where to display the aggregate.
setFormula(formula)
Sets the operations to perform on values in the custom summary formula.
setFormulaType(value)
Sets the format of the numbers in the custom summary formula.
setFormulaType(formulaType)
Sets the format of numbers used in the custom summary formula.
setLabel(label)
Sets the user-facing name of the custom summary formula.
toString()
Returns a string.
TopRows Class
The new Reports.TopRows class describes a row limit filter.
getDirection()
Returns the sort order of the report rows.
getRowLimit()
Returns the maximum number of rows shown in the report.
setDirection(value)
Sets the sort order of the report’s rows.
setDirection(direction)
Sets the sort order of the report’s rows.
setRowLimit(rowLimit)
Sets the maximum number of rows included in the report.
toString()
Returns a string.

Changed Apex Classes

These existing classes have new or changed methods or constants.
Auth.AuthConfiguration Class
New Method
isCommunityUsingSiteAsContainer()
Returns true if the community uses Site.com pages; otherwise, returns false.
Auth.SessionManagement Class
New Methods
generateVerificationUrl(policy, description, destinationUrl)
Initiates a user identity verification flow with the verification method that the user registered with, and returns a URL to the identity verification screen. For example, if you have a custom Visualforce page that displays sensitive account details, you can prompt the user to verify identity before viewing it.
getRequiredSessionLevelForProfile(profileId)
Indicates the required login security session level for the given profile.
validateTotpTokenForKey(totpSharedKey, totpCode, description)
Indicates whether a time-based one-time password (TOTP) code (token) is valid for the given shared key.
validateTotpTokenForUser(totpCode, description)
Indicates whether a time-based one-time password (TOTP) code (token) is valid for the current user.
Changed Methods
validateTotpTokenForKey(sharedKey, totpCode)
Deprecated. Use validateTotpTokenForKey(totpSharedKey, totpCode, description) instead.
validateTotpTokenForUser(totpCode)
Deprecated. Use validateTotpTokenForUser(totpCode, description) instead.
Cache.Org Class
New Method
getName()
Returns the name of the default cache partition.
New Constant
MAX_TTL_SECS
The Org class provides a constant that you can use when setting the time-to-live (TTL) value.
Cache.Session Class
New Method
getName()
Returns the name of the default cache partition.
New Constant
MAX_TTL_SECS
The Session class provides a constant that you can use when setting the time-to-live (TTL) value.
QuickAction.QuickActionResult Class
New Method
getSuccessMessage()
Returns the success message associated with the quick action.
Reports.ReportMetadata Class
New Methods
getBuckets()
Returns a list of bucket fields in the report.
getCrossFilters()
Returns information about cross filters applied to a report.
getCustomSummaryFormula()
Returns information about custom summary formulas in a report.
getTopRows()
Returns information about a row limit filter, including the number of rows returned and the sort order.
setBuckets(buckets)
Creates bucket fields in a report.
setCrossFilters(crossFilters)
Applies cross filters to a report.
setCustomSummaryFormula(customSummaryFormula)
Adds a custom summary formula to a report.
setTopRows(topRows)
Applies a row limit filter to a report.
System.SandboxPostCopy Class
New Method
runApexClass
To make your sandbox environment business ready, automate data manipulation or business logic tasks. At sandbox creation, specify a single Apex class to perform the tasks. This class executes every time the sandbox is copied, and provides context for org ID, sandbox ID, and sandbox name.
System.Approval Class
New Methods
isLocked(id)
Returns true if the record with the ID id is locked, or false if it’s not.
isLocked(ids)
Returns a map of record IDs and their lock statuses. If the record is locked the status is true. If the record is not locked the status is false.
isLocked(sobject)
Returns true if the sobject record is locked, or false if it’s not.
isLocked(sobjects)
Returns a map of record IDs to lock statuses. If the record is locked the status is true. If the record is not locked the status is false.
System.Site Class
New Methods
getPasswordPolicyStatement()
Returns the password requirements for a community created with the Napili template.
isValidUsername(username)
Returns true if the given username is valid; otherwise, returns false.
validatePassword(user, password, confirmPassword)
Indicates whether a given password meets the requirements specified by org-wide or profile-based password policies in the current user’s org.
System.System Class
New Method
isQueueable()
Returns true if a queueable Apex job invoked the executing code. Returns false if not, including if a batch Apex job or a future method invoked the code.
Changed Method
isBatch()
Returns true if a batch Apex job invoked the executing code, or false if not. In API version 35.0 and earlier, also returns true if a queueable Apex job invoked the code.
System.Test Class
New Method
setCreatedDate(recordId, createdDatetime)
Sets CreatedDate for a test-context sObject.
System.UserInfo Class
Changed Methods
getUiTheme()
Returns the preferred theme for the current user. The range of possible return values is expanded to support Salesforce1 and Lightning Experience.
getUiThemeDisplayed()
Returns the theme being displayed for the current user. The range of possible return values is expanded to support Salesforce1 and Lightning Experience.

New Apex Enums

These enumerations were introduced in this release.
Auth.VerificationPolicy Enum
The Auth.VerificationPolicy enum contains an identity verification policy value used by the SessionManagement.generateVerificationUrl method.
Reports.BucketType Enum
The types of values included in a bucket.
Reports.CsfGroupType Enum
The group level at which the custom summary format aggregate is displayed in a report.
Reports.FormulaType Enum
The format of the numbers in a custom summary formula.

New Apex Exception

This exception was introduced in this release.
Cache Namespace
ItemSizeLimitExceededException
Thrown when a cache put call is made with an item that exceeds the maximum size limit.

New Apex Interfaces

These interfaces were introduced in this release.
Auth.AuthProviderPlugin Interface
Use AuthProviderPlugin to create a custom OAuth-based authentication provider plug-in for single sign-on to Salesforce.
getCustomMetadataType()
Returns the custom metadata type API name for a custom OAuth-based authentication provider for single sign-on to Salesforce.
getUserInfo(authProviderConfiguration, response)
Returns information from the custom authentication provider about the current user. This information is used by the registration handler and in other authentication provider flows.
handleCallback(authProviderConfiguration, callbackState)
Uses the authentication provider’s supported authentication protocol to return an OAuth access token, OAuth secret or refresh token, and the state passed in when the request for the current user was initiated.
initiate(authProviderConfiguration, stateToPropagate)
Returns the URL where the user is redirected for authentication.
System.SandboxPostCopy Interface
Use SandboxPostCopy to complete tasks after a sandbox is created or refreshed. Create the class with the methods you wish to run, then specify the class when you create a sandbox.

Changed Apex Interfaces

These interfaces were changed in this release.
TxnSecurity.PolicyCondition Interface
The Alert on IP Range Changes example has been removed.