• DY Dharam
  • NEWBIE
  • 5 Points
  • Member since 2019


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Can I create any record as a system administrator from the guest user community without any web-service or any API integration.
Hi, I'm struggling with getting ALL of the field names for an object in APEX. When running the code below (in APEX), I am getting most of the fields but it's omitting a few contact fields as well as the comment field. When I run the block of code in anonymous apex, all the fields I need are returning. Is there something I might be missing? Thanks in advanced.
 
Schema.SObjectType targetType = Schema.getGlobalDescribe().get('case');
Map<String, Schema.SObjectField> fieldMap = targetType.getDescribe().fields.getMap();
    for (Schema.SObjectField field : fieldMap.values()) {
         System.debug(field.getDescribe().getName());
     }

 

Hi I tried teh below code to get all fields of all objects.. i'm getting too many field describes error as the field describe is above 100. Please suggest how to resolve this issue?

 

 Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
   Map<String,Schema.SObjectField> theFieldmap;
       for(Schema.SObjectType s:gd.values()){
     Schema.DescribeSObjectResult r = s.getDescribe();
           theFieldmap= r.fields.getMap();
            }

  • July 23, 2013
  • Like
  • 0