It's a bit inconvenient that this returns null:
system.debug( Schema.getGlobalDescribe().get('KnowledgeArticleVersion') );
While this does not:
system.debug( KnowledgeArticleVersion.getSObjectType().getDescribe() );
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityIt's a bit inconvenient that this returns null:
system.debug( Schema.getGlobalDescribe().get('KnowledgeArticleVersion') );
While this does not:
system.debug( KnowledgeArticleVersion.getSObjectType().getDescribe() );
This will work for you:
DescribeSObjectResult objType = KnowledgeArticleVersion.getSObjectType().getDescribe();
Map<String, SObjectField> fields = objType.fields.getMap();
Set<String> fieldSet = fields.keySet();
for(String s:fieldSet)
{
SObjectField fieldToken = fields.get(s);
DescribeFieldResult selectedField = fieldToken.getDescribe();
System.debug(selectedField.getName());
}
KnowledgeArticleVersion is not available for Schema.getGlobalDescribe().get().