Summary
Ensure all SObjects in the input list are of the same type before returning the first record.
Proposed Change
- Add validation logic in
getFirstRecord to check that all records are of the same SObject type.
- Return an error message or null if types are mixed.
Benefit
Prevents unexpected casting issues and improves robustness.
Summary
Ensure all SObjects in the input list are of the same type before returning the first record.
Proposed Change
getFirstRecordto check that all records are of the same SObject type.Benefit
Prevents unexpected casting issues and improves robustness.