function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ankur SrivastavaAnkur Srivastava 

Mapping API Names to the Label Names using Metadata API

I am using Metadata API for a certain requirements related to profiles. I am using getFullName() method to retrieve the Profile name.
However I am finding a difference in the actual result returned.
For eg. if the Profile Label Name is : System Administrator, so the returned name is : Admin
Since the count of profiles is huge so I am looking for a programmatic approach to this mapping.
Best Answer chosen by Ankur Srivastava
KevinPKevinP
ankur,

Though I'm not 100% sure, I believe the only time the getFullName will differ is on *standard out of the box* profiles

Additionally, you can query the profile object in soql, and bypass the metadata api. In which case you'll want something like this:
 
select CreatedById, CreatedDate, Description, Id, LastModifiedById, LastModifiedDate, LastReferencedDate, LastViewedDate, Name from Profile