Created
March 24, 2022 23:59
-
-
Save gitmatheus/a57e65ee19826cb1d8d55b5ac9df538e 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
public class FieldReader implements IFieldReader { | |
// Retrieves a value from a field, as an object | |
public Object getFieldValue(SObject record, String fieldName) { | |
return record.get(fieldName); | |
} | |
// Retrieves a value from a field, as a SObject | |
public SObject getFieldRecord(SObject record, String fieldName) { | |
return record.getSObject(fieldName); | |
} | |
// Retrieves a value from a field, as a List of SObject | |
public List<SObject> getFieldRecords(SObject record, String fieldName) { | |
return record.getSObjects(fieldName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment