You need to sign in to do that
Don't have an account?
ccolt
get api name
Hi,
I need to get the api names of the items of an object.
I can get the Name and Value with the getMap() method. But how i can get the API name.
I have a prefix problem with managed packets, so I need this thing.
e.g.
custom item in Contact >> married.
API name with prefix
prefix__married_c
how can i get this thing?
i can get with getMap() or getLabel() the married__c but not with prefix.
thanks for help.
greetings.
CCOLT,
Try this, it generates an unsorted list of Fields, the getName function returns the API name of each field. Make sure you change the ObjectName var (highlighted in red) to the object you wish to list the fields for.
Hi,
thanks bbrantly1, but as I said in my post, the getMap() method read the value and name but not the complete api-name (with prefix)
e.g.
CostumField in Contact married
I don´t need
married__c
but
mycompanyPrefix__maried__c
thanks for help.
Try this:
The 'getName()' method should return the API Name without the namespace prefix.
Meant to say
'The 'getName()' method should return the API Name WITH the namespace prefix.'