Changing the API name of a custom field in Salesforce is possible but carries significant risk. It is strongly recommended not to change the API name of a field unless absolutely necessary. Field API names are referenced across many types of metadata in a Salesforce org, including Apex Classes, Apex Triggers, Visualforce Pages, Visualforce Components, and web service callouts in Apex code. Renaming a field API name without first removing all existing references causes errors and the change may be unsupported.
Real-World Example: If a managed package field has the API name vlocity_cmt__DeliveryMethod__c and your custom field is also named DeliveryMethod__c, this creates a conflict. Rename your custom field to something unique like OurDeliveryMethod__c to avoid the conflict.
Before making any changes, locate every place the existing API name is referenced in your org metadata:
Use the Salesforce Extension for VS Code to retrieve your org metadata and search all occurrences of the old API name.
Remove or update every reference to the old API name before proceeding with the rename. Failing to do this causes runtime errors after the rename.
After the rename, update all Apex Classes, Triggers, and Visualforce components to reference the new API name, then redeploy the updated metadata to your org.
If any external integrations or Apex-based web service callouts reference the old API name, update those references to the new API name and redeploy.
As an example, if you encounter conflicts with managed package fields, you may need to rename the custom field API to avoid such issues. For example, if a managed package field has the API name "vlocity_cmt__DeliveryMethod__c", you should rename your custom field from "DeliveryMethod__c" to something unique like "OurDeliveryMethod__c".
Steps to Rename Field API Names:
1. Click the Setup gear icon, then select Setup.
2. Select Object Manager, then select the relevant object.
3. In Fields & Relationships, search for the custom field.
4. Click the dropdown arrow next to the field, select Edit, and change the field name.
5. Click Save.
000382423

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.