Skip to content

A collection of Apex classes that help you get information of whether or not a record has suffered changes from a field within a field set

License

Notifications You must be signed in to change notification settings

Dogeforce/apex-record-ischanged-from-fieldset

Repository files navigation

Apex Records "Is Changed" from Field Set

This repository contains some Apex classes that help with detecting changes in fields that are in one or more field sets.

Usage

First deploy the classes in this repository, and then in your code you may call the isAnyFieldFromFieldSetsChanged methods from the RecordFieldChanges class.

For example:

// use the field set names you want to check, and the records list and their
// previous values
RecordFieldChanges.isAnyFieldFromFieldSetsChanged(
    new List<String>{ 'some field set name' },
    new Map<Id, SObject>{ record1, record2, ... },
    new Map<Id, SObject>{ record1, record2, ... }
)

// in a trigger context, you can omit the two extra params because we'll read
// from Trigger.newMap and Trigger.oldMap
RecordFieldChanges.isAnyFieldFromFieldSetsChanged(
    'some field set name'
)

About

A collection of Apex classes that help you get information of whether or not a record has suffered changes from a field within a field set

Topics

Resources

License

Stars

Watchers

Forks