sObject.getPopulatedFieldsAsMap() doesn't return fields that have been added to an sObject after it has been retrieved via a SOQL query
Last updated 2022-02-10 ·Reference W-3223800 ·Reported By 14 users
Summary
sObject.getPopulatedFieldsAsMap() doesn't return fields that have been added to an sObject after it has been retrieved via a SOQL query.
Repro
Execute below anonymous Apex code in the Developer Console. "Title" will not be present:
Contact c = [select name from contact limit 1];
c.Title = 'President';
Map<String, Object> fieldsMap = c.getPopulatedFieldsAsMap();
Workaround
N/A
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.