Created
July 22, 2022 06:58
-
-
Save aidan-harding/6b03f7f377119f3825781c10d018629b to your computer and use it in GitHub Desktop.
Lambda-like class with lots of casting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class IsYearChanged extends nebc.TriggerContextBooleanFunction { | |
public override Boolean isTrueFor(SObject oldRecord, SObject newRecord) { | |
Term__c oldTerm = (Term__c)oldRecord; | |
Term__c newTerm = (Term__c)newRecord; | |
return Math.abs(oldTerm.Start_Date__c.year() - newTerm.Start_Date__c.year()) > 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment