AqObjAqTestObject
Trigger and domain methods for test object, used only for unit test coverage for Aq framework.
Inheritance
AqObj > AqObjAqTestObject
Group apex/core
Fields
public Operations → List<String>
public FailRequirement → Boolean
public RequiredField → SObjectField
public RequiredFields → Set<SObjectField>
public RequiredTogether → Set<SObjectField>
public ValidateStringField → SObjectField
public ValidateStringDatatype → String
public ValidateStringRequired → Boolean
public ValidateStringLength → Integer
public ValidatePatternField → SObjectField
public ValidatePatternRequired → Boolean
public ValidatePatternRegex → String
public ValidatePatternLabel → String
public ValidateIntegerField → SObjectField
public ValidateIntegerRequired → Boolean
public ValidateIntegerMin → Integer
public ValidateIntegerMax → Integer
public CaptureChangedFields → Boolean
public ChangedFields → List<Set<SObjectField>>
public ChangedAnyFields → Set<SObjectField>
public ChangedFromToField → SObjectField
public ChangedFromValue → object
public ChangedToValue → object
public IsChangedAnyFields → Boolean
public IsChangedFrom → Boolean
public IsChangedTo → Boolean
public IsChangedToNonNull → Boolean
public oldRecords → List<sObject>
public oldRecord → sObject
public oldValue → object
public RECORD_TYPE_1 → String
public RECORD_TYPE_2 → String
Properties
protected TriggerRecords → List<SObject>
Inherited
Returns relevant set of records for processing in the trigger This includes management of errored records within the same instantiation, so that error records aren't presented to methods for downstream processing.
Methods
Other
public static void clearOperations()
public void recordChangedFields(TestObject__c record)
protected override void preValidate(List<sObject> records)
protected override void preValidateDelete(List<sObject> records)
protected override void initialize(List<sObject> records)
protected override void calculate(List<sObject> records)
protected override void validate(List<sObject> records)
protected override void postInsert(List<sObject> records)
protected override void postUpdate(List<sObject> records)
protected override void postUpsert(List<sObject> records)
protected override void postDelete(List<sObject> records)
Public methods
public virtual void onTrigger()
Inherited
Entry method called from the trigger itself Extend your SObject trigger handler class from AqObj (e.g. AccountObj). Create the corresponding .trigger class and call onTrigger() method. All the protected triggers methods mentioned below gets TriggerRecords list as a parameter. Account.trigger:
Example
trigger Account on Account (before insert, before update, after update) {
new AccountObj().onTrigger();
}
//
// In your handler, override required protected trigger method (`preValidateDelete()` |
// `preValidate()` | `initialize()` | `calculate()` | `validate()` |
// `postInsertUpsertDelete()` | `postInsert()` | `postUpsert()` | `postUpdate()` | `postDelete()`)
// and put your trigger logic inside, e.g.:
//
protected override void postUpdate(List<SObject> records) {
this.updateAccountFields(records);
}
Protected triggers methods
protected virtual void postInsertUpsertDelete(List<sObject> records)
Inherited
Do any processing that should happen after insert, update, or delete
Protected auxiliary methods
protected void addError(sObject record, sObjectField field, String errorString)
Inherited
Add error to a record
protected Boolean isInsert()
Inherited
protected Boolean isUpdate()
Inherited
protected Boolean isDelete()
Inherited
protected Boolean isUndelete()
Inherited
protected List<sObject> oldRecords()
Inherited
Return old records
protected sObject oldRecord(sObject record)
Inherited
Return old record
protected object oldValue(sObject record, sObjectField field)
Inherited
Return old field value
protected Map<Id,sObject> getOldMap()
Inherited
Return old records
Protected validation methods
protected void require(sObject record, sObjectField field, Boolean condition, String errorMessage)
Inherited
Works like an assert to add error if condition is not met
protected void requireFields(sObject record, Set<sObjectField> fields)
Inherited
Required the record to have values set on all specified fields
protected void requireField(sObject record, sObjectField field)
Inherited
Required the record to have values set on the specified field
protected void requireTogether(sObject record, Set<SObjectField> fields)
Inherited
If any are not-null, then all must be not-null
protected void validateString(sObject record, sObjectField field, String dataType, Boolean required, Integer maxLength)
Inherited
Validate a string against specified type
protected void validateString(sObject record, sObjectField field, String dataType, Boolean required)
Inherited
Validate a string against specified type
protected void validateString(sObject record, sObjectField field, String dataType)
Inherited
Validate a string against specified type
protected void validatePattern(sObject record, sObjectField field, Boolean required, String regEx, String patternLabel)
Inherited
Validate a string to meet specified pattern
protected void validateInteger(sObject record, sObjectField field, Boolean required, Integer min, Integer max)
Inherited
Validate an integer for range
protected Boolean isChangedField(sObject record, sObjectField field)
Inherited
Change detection Returns true if field is changed in this trigger context
protected Boolean isChangedAnyField(sObject record, Set<sObjectField> fields)
Inherited
Returns true if any specified field is changed in this trigger context
protected Boolean isChangedFieldFrom(sObject record, sObjectField field, object fromValue)
Inherited
Returns true if field changed from specified value to some other value
protected Boolean isChangedFieldTo(sObject record, sObjectField field, object toValue)
Inherited
Returns true if field changed to specified value
protected Boolean isChangedFieldToNonNull(sObject record, sObjectField field)
Inherited
Returns true if field changed and to a non-null value