092_Schema获取表字段的方式

Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get('ObjectName').getDescribe().fields.getMap();
List<String> fieldList = new List<String>();

for(string s:objectFields.keySet()){
fieldList.add(s);
}

System.debug('************:'+fieldList);

System.debug( '&&&&&:'+String.join( fieldList, ', ') );

此刻,静下心来学习
原文地址:https://www.cnblogs.com/bandariFang/p/12491360.html