How can I rename my Apex Class name in Salesforce

0 votes
How can i rename my Apex class?

For example if I want to change the name of my apex class from name1 to name2, how can I do that?
Mar 29 in SalesForce by surbhi
• 3,810 points
190 views

1 answer to this question.

0 votes

If you wanted to do it through a metadata deployment, your only option would be to delete the old class and create a new one.

In the ui (Setup > Develop > Apex Classes), you can change the class name, but it won't change any of the references, so if you don't manually change all references to the class, you might start getting errors that say:

Dependent class is invalid and needs recompilation

Renaming a class in the ui will associate a different name with the same salesforce id for the class, so there is a subtle difference between that and deleting and creating a new class.

answered Apr 1 by CoolCoder
• 4,360 points

Related Questions In SalesForce

0 votes
1 answer

Apex Class and Apex Trigger is invisible in Salesforce Developer Console

You'll need to create a new developer ...READ MORE

answered Mar 8 in SalesForce by anonymous
98 views
0 votes
0 answers

How to Write the Test class for Salesforce Apex Aura Enabled class?

stuck in here to write a test ...READ MORE

Mar 15 in SalesForce by surbhi
• 3,810 points
95 views
0 votes
1 answer

How do i get all values from a global pick list in salesforce using REST Api?

Since API 39.0 it is possible to ...READ MORE

answered Mar 17 in SalesForce by CoolCoder
• 4,360 points
718 views
0 votes
1 answer

Salesforce Apex/JSON serialization with change on variable name

Apex does not support annotation for serialization. But, ...READ MORE

answered Mar 2 in SalesForce by surbhi
• 3,810 points
295 views
+2 votes
2 answers

Salesforce Interview questions

Here are some questions very important for ...READ MORE

answered Jan 11, 2019 in Career Counselling by Suresh
• 720 points
1,871 views
0 votes
1 answer

How to connect to salesforce from tableau?

Hi, follow these steps to connect to Salesforce: 1. ...READ MORE

answered Mar 25, 2019 in Tableau by Cherukuri
• 33,010 points
302 views
0 votes
1 answer

Power BI - Salesforce

Hi, Follow below steps: 1. Go to Data source. 2. ...READ MORE

answered Mar 25, 2019 in Power BI by Cherukuri
• 33,010 points
182 views
0 votes
1 answer

What is the best training for Salesforce ADM-201 Exam?

Hi @Vardhan, I took Edureka's Salesforce Training that covers all ...READ MORE

answered Jun 3, 2021 in Others by Jaya
• 140 points

edited Dec 22, 2021 by Soumya 215 views
0 votes
1 answer

How can i use select * in SOQL query in Salesforce?

SOQL is not the same as SQL. ...READ MORE

answered Mar 3 in SalesForce by CoolCoder
• 4,360 points
221 views
0 votes
1 answer

How to add days to date time in Salesforce Apex?

Beware the DST issue! The "addDays" function ...READ MORE

answered Mar 15 in SalesForce by CoolCoder
• 4,360 points
510 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP