I am trying to rename existing field's API name. I know that before that I have to remove all references from class, VF pages..etc. Currently I am trying to fetch all references like classes and field metadata (xml file) in VS code and trying to deploy back with the updated name but it is creating new fields instead of overwriting the existing field. Can any one let me know that how should I proceed? shall I have to remove all references in the org manually then change the field API name. Post that put back all changes again manually?

1 Answer 1


Assume you making the changes in sandbox and deploying to production, you will need to:

1.Comment all the references in code in sandbox and deploy it to production.

2.Rename the fields in sandbox and production manually.

3.Uncomment the code in sandbox and modify the references to the new fields API names and deploy the updated code to production.

  • Thanks! is there any automated way bz I have to deploy this using CICD?
    – Raj SF
    Sep 1, 2020 at 12:42
  • There are advanced tools for deployment like clickdeploy or gearset that may make the process easier, the best tools will usually require license. But anyway for changing API fields name you will need to follow the above steps and probably step 2 will need to be done manually, because when moving field from sandbox to production the process identify the field by its API name. If the API name was changed it cannot know that it should update something
    – Liron C
    Sep 1, 2020 at 13:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .