Skip to content

Record API in AfterUndelete ​

Record ​

Type: TriggerTypes.UndeleteRecord. Predicates read the new row and never throw on null.

MethodIn AfterUndelete
getId()the record Id
getNewSObject()the Trigger.new row, read-only
getNewParent(lookupField)the parent loaded by ParentQuery, or null
getRelated(providerName)rows from a RelatedQuery provider
isRecordType(recordTypeDeveloperName), isNotRecordTyperecord type developer name matches / differs
equals(field, value), doesNotEqualequal / different; text ignores case
isIn(field, values), isNotInequal to one of the values / to none; text ignores case
contains(field, value), doesNotContain, startsWith, endsWithtext match; case-sensitive
isNull(field), isNotNullnull / not null
isEmpty(field), isNotEmptynull or '' / neither
isBlank(field), isNotBlanknull, '' or whitespace / none
isTrue(field), isFalsetrue / false
greaterThan(field, value), greaterThanOrEqualTo, lessThan, lessThanOrEqualTonumber or date comparison; false for null

Records ​

Type: TriggerTypes.UndeleteRecords. RecordsProvider.query gets the whole chunk. dispatchOnAfterUndelete and finalizeOnAfterUndelete get the qualified records.

MethodIn AfterUndelete
getIds()the record Ids
getIdsOf(field)non-null Ids in a lookup or Id field
getIdsOf(relationshipName, field)Ids in a field of a parent loaded by ParentQuery
getValuesOf(field)non-null values of a field, as text
getValuesOf(relationshipName, field)values of a field of a parent loaded by ParentQuery, as text
getRecords()the records, as UndeleteRecord
size()the number of records

Rules ​

  • No change detection. The record holds the values it had when it was deleted.
  • Reject with addError. record.getNewSObject().addError(…) keeps that record in the Recycle Bin.
  • 0 and false are values. They are not null, empty or blank.