You need to sign in to do that
Don't have an account?
Anil Kamisetty
Schema Class - Not returning all Fields
Fields on an Object can be obtained by the following statement.
Note : Asset is the Object API
Map<String,Schema.SObjectField> mfields = Schema.getGlobalDescribe().get('Asset').getDescribe().fields.getMap();
System.debug('Map size = ' + mfields.size()) ; << 26 not 31
I am wondering why the number of elements is returned as 26 not 31 ? Following elements are missed out. List of fields not reported are productcode, assetprovidedbyid, assetservicedbyid, isinternal, assetlevel (total 5 fields).
Why not all fields are reported in the SCHEMA Class ? As it is salesforce class, it should report everything. On top of it, ASset is a standard object and we are talking about standard fields only
On the Asset object, the standard field API Names are given below (total : 31)
id,contactid,accountid,parentid,rootassetid,product2id,productcode,iscompetitorproduct,createddate,createdbyid,lastmodifieddate,lastmodifiedbyid,systemmodstamp,isdeleted,name,serialnumber,installdate,purchasedate,usageenddate,status,price,quantity,description,ownerid,assetprovidedbyid,assetservicedbyid,isinternal,assetlevel,stockkeepingunit,lastvieweddate,lastreferenceddate
Note : Asset is the Object API
Map<String,Schema.SObjectField> mfields = Schema.getGlobalDescribe().get('Asset').getDescribe().fields.getMap();
System.debug('Map size = ' + mfields.size()) ; << 26 not 31
I am wondering why the number of elements is returned as 26 not 31 ? Following elements are missed out. List of fields not reported are productcode, assetprovidedbyid, assetservicedbyid, isinternal, assetlevel (total 5 fields).
Why not all fields are reported in the SCHEMA Class ? As it is salesforce class, it should report everything. On top of it, ASset is a standard object and we are talking about standard fields only
On the Asset object, the standard field API Names are given below (total : 31)
id,contactid,accountid,parentid,rootassetid,product2id,productcode,iscompetitorproduct,createddate,createdbyid,lastmodifieddate,lastmodifiedbyid,systemmodstamp,isdeleted,name,serialnumber,installdate,purchasedate,usageenddate,status,price,quantity,description,ownerid,assetprovidedbyid,assetservicedbyid,isinternal,assetlevel,stockkeepingunit,lastvieweddate,lastreferenceddate