You need to sign in to do that
Don't have an account?
TeeJay Bagain
Getting Field API Names Case-sensitive
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
How do I achieve this? Some people have done it yet I still don't get it.
Your help is deeply appreciated.
Thank you!
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!
This is my example for Contact, it will return Field API Names Case-sensitive :
Manh
All Answers
This is my example for Contact, it will return Field API Names Case-sensitive :
Manh