• TeeJay Bagain
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am trying to get the API Names of a field of a certain object.

For example, I have a field named Testing with an API name of Testing__c.

However when I use 
Set<String> fieldExistingCompare = new Set<String>();

Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Map<String, Schema.SObjectField> fieldMap = schemaMap.get('Request__c').getDescribe().fields.getMap();
Then getting the values via loop like this...
for (String fieldAPINameIN: fieldMap.keySet())
{
              fieldExistingCompare.add(fieldAPINameIN);
}
I get testing__c instead. I need to get the actual API Name of the field with the proper capitalizations.

How do I achieve this? Some people have done it yet I still don't get it.

Your help is deeply appreciated.

Thank you!


I am trying to get the API Names of a field of a certain object.

For example, I have a field named Testing with an API name of Testing__c.

However when I use 
Set<String> fieldExistingCompare = new Set<String>();

Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Map<String, Schema.SObjectField> fieldMap = schemaMap.get('Request__c').getDescribe().fields.getMap();
Then getting the values via loop like this...
for (String fieldAPINameIN: fieldMap.keySet())
{
              fieldExistingCompare.add(fieldAPINameIN);
}
I get testing__c instead. I need to get the actual API Name of the field with the proper capitalizations.

How do I achieve this? Some people have done it yet I still don't get it.

Your help is deeply appreciated.

Thank you!


I am trying to get the API Names of a field of a certain object.

For example, I have a field named Testing with an API name of Testing__c.

However when I use 
Set<String> fieldExistingCompare = new Set<String>();

Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
Map<String, Schema.SObjectField> fieldMap = schemaMap.get('Request__c').getDescribe().fields.getMap();
Then getting the values via loop like this...
for (String fieldAPINameIN: fieldMap.keySet())
{
              fieldExistingCompare.add(fieldAPINameIN);
}
I get testing__c instead. I need to get the actual API Name of the field with the proper capitalizations.

How do I achieve this? Some people have done it yet I still don't get it.

Your help is deeply appreciated.

Thank you!


Hi,

 

i'm writing a Visualforce Controller where i need to get the Api Names of the fields of a specific Object, but everything i get is only lower case. I actually need them like they are originally named, because of a WebService Call i'm doing with those field names.

 

Is there any way to get the api names of fields and objects original, and why are they lowercase anyway?

 

Thanks

Michael Kahle