Background. My manager asked me to retrieve all currency fields for many custom objects.
Amongst them there was at least one object with many fields which have field access Hidden. Let's call that object "Some Big Object".
I was trying to execute following code snippet
String s1 = '';
String s2 = '';
for ( Schema.sObjectField fi : Schema.SObjectType.Some_Big_Object__c.fields.getMap().values() ){
s1 += fi.getDescribe().getLabel() + '; ';
}
for ( Schema.FieldSet fi : Schema.SObjectType.Some_Big_Object__c.fieldSets.getMap().values() ){
s2 += fi.getLabel() + '; ';
}
System.debug(LoggingLevel.ERROR, '!!!. 1 ' + s1 );
System.debug(LoggingLevel.ERROR, '!!!. 1 ' + s2 );
However, to my great surprize, this didn't retrieved any of hidden fields.
So the list in debug log was following:
Big Object Name; Deleted; Created Date; System Modstamp; Owner ID; Last Modified By ID; Created By ID; Last Modified Date;
while I was expecting to see "Some Field To Retrieve" amongst this list.
Does anyone know if there exists any kind of lifehack to retrieve list of ALL fields of some object including hidden ones?