0

I just installed Eclipse and the Force.com IDE and I cannot figure out how to use the IDE to change field labels. I understand that API names cannot be changed and that is fine.

For example, I have a field on the Contact object called "New Parent" with an API of "New_Parent__c". How would I go about changing the field label through the IDE? Thank you in advance for your help.

2

First, you need to have pulled that field as part of your project metadata through the Add/Remove Components interface (under right click project->Force.com).

When the field metadata has been pulled, you'll have a file called Contact.object in your src/objects directory. Open that file and you'll find, as one portion of the lengthy XML source that defines the object, a number of entries that look like this:

<fields>
    <fullName>New_Parent__c</fullName>
    <defaultValue>false</defaultValue>
    <externalId>false</externalId>
    <inlineHelpText></inlineHelpText>
    <label>New Parent</label>
    <trackFeedHistory>false</trackFeedHistory>
    <type>Checkbox</type>
</fields>

You can alter your field's label there. Save the file in Eclipse and it should deploy automatically back to the server, unless you've configured your project to disable that behavior. Be aware, if you dive in, that it's fairly easy to introduce problems with dependencies by making data model changes in the XML source, and you'll get a deployment error if that happens. If you stick to field labels, you should be OK.

Note that you actually can change field API names, although of course you cannot change the API names of standard fields.

| improve this answer | |
  • +1 but, you can't change API names in the Force.com IDE; you'll end up creating a duplicate field with a new name. – sfdcfox Jun 28 '18 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.