1

I have a requirement to update the field labels of 200 fields in a custom object and mass delete another 100 fields. what is the most time efficient way to accomplish this? I read a post that said this might be possible using ANT tool or Force.com IDE and change the XML or maybe using Salesforce Toolkit: http://sftoolkit.co/. Has anyone done something similar to this? Thanks for your time.

5

An IDE is arguably the easiest way to edit fields. Simply pull down the object, edit all the labels, then save the changes. You can do this in MavensMate, Force.com IDE, and others that support the object folder (most, if not all, do).

To delete fields, you need a destructive tool. My tool of choice is the Ant Toolkit or the Workbench. Simply create a "destructiveChanges.xml" file that contains a list of fields to delete:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
 <types>
   <members>ObjectName.FieldName1</members>
   <members>ObjectName.FieldName2</members>
   <members>ObjectName.FieldName3</members>
   <members>ObjectName.FieldName4</members>
   ...
   <name>CustomField</name>
  </types>
  <version>42.0</version>
</Package>

Note that you also need an empty package.xml for this:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
  <version>42.0</version>
</Package>

Also see this answer which goes into greater detail on using the Workbench.

| improve this answer | |
  • Hi, I tried the force.come IDE to update the field label and I am getting errors when I save it back to the server. In the "Choose Initial Project Contents"- I selected "Selected Metadata Components" and then I selected custom and Standard objects. Once the process was done, I opened the contact object and changed the filedlabel for a custom field and after saving the file, I right click the Project-Force.com-Deploy to server.Once the process finishes I get around 100 errors in the classes and triggers even though the field isn't referenced anywhere else. Is there something I am doing wrong? – Sooraj Apr 24 '18 at 16:18
  • @Sam What were the errors? Conceptually, it should have worked. – sfdcfox Apr 24 '18 at 16:20
  • in the category of other IDEs: Illuminated Cloud supports mass edits – cropredy Apr 24 '18 at 16:32
  • @cropredy Yeah, the wording was a bit ambiguous. There are definitely others, like I know Cloud9 supports it as well. I edited it to be a little more concrete. – sfdcfox Apr 24 '18 at 16:39
  • @sfdcfox I am not sure what went wrong the first time, but when I tried it again, it was successful. Thanks for your help. – Sooraj Apr 24 '18 at 18:41

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.