Last active
March 25, 2022 01:28
-
-
Save gitmatheus/a9dc6cf183893d6b482ec3b43045a4f6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Snippet from the AccountTriggerHandler | |
... | |
// If the mock data is not being used | |
// creates new instances of the real deal | |
public AccountTriggerHandler() { | |
this(new DataLayer(), new FieldReader()); | |
} | |
// Child_Accounts__r is a nonwritable child relationship | |
// Uses the field reader to retrieve the list of child records: | |
List<Account> childRecords = | |
fieldReader.getFieldRecords(parentAndChildAccount, 'Child_Accounts__r'); | |
// Updates the field Latest Child URL with the value from External_URL__c | |
// External_URL__c is a formula field (nonwritable string) | |
newRecord.Latest_Child_URL__c = | |
(String)fieldReader.getFieldValue(latestChild, 'External_URL__c'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment