You need to sign in to do that
Don't have an account?
Michael_Kahle
Apex Describe Field ApiNames not CaseSensitive
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
Hey
Check the labels and names for your object and fields in the Setup>create>objects menu. Perhaps they've been captured in lowercase.
Wes
Hi wesnolte,
I get the Labels perfect, the problem are the Api Names of fields and objects. Even the Standard ones like "BillingCity" is given back as "billingcity. So it's not a issue of how they've been captured.
thanks
Michael Kahle
Cool, had to ask;) How are you getting the names of the objects and fields? Using describes?
Wes
Hi wesnolte,
I found the problem, i used the fields.getMap().keySet() function which only contains lowerCase. Now i'm getting every Name i need with the describeField(name).getName() and getting the original names.
Thanks for your help
Michael Kahle
Can you explain how you got the API Names with your method?
Thank you!