function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sarah DallimoreSarah Dallimore 

Disable or delete an Apex Class from production

Hello

I use Declarative Lookup ROllup Summary which will no longer work now that I have enabled Chatter Answers -  I get the following error message.

ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [ProfileId]: [ProfileId] Class.ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser: line 31, column 1

We don't use Chatter so that people can register so I don't believe we need the actual class at all but I can't see a way to deploy deleted ape classes to production. I have tried making a few amendments based on amending the class on instructios in this link: https://success.salesforce.com/issues_view?id=a1p300000008XHfAAM

However when i then deploy to production i get the following error: 
System.AssertException: Assertion Failed: A new user should have been created 
Stack Trace: Class.ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser: line 11, column 1

I don't really know the first thing about apex classes and i am not a developer so need as much help as possible with this. I don't have Eclipse or anything like that. APpreciate any help with this. Cheers
 
Bhushan Mahajan 5Bhushan Mahajan 5
hi,
Sarah Dallimore

You can use force.com IDE(Ecilpse) for deleteing class form  productions.
 
Sarah DallimoreSarah Dallimore
Thanks Bhushan. I'd mentioned I don't have Eclipse which is why I was looking for an alternative solution. Is there no other way to remove these classes without it? Thanks
Bhushan Mahajan 5Bhushan Mahajan 5
Hi, 

Sarah Dallimore

No other way of deleting classes form production.
The Eclipse  is better way for deleting classes.
Sarah DallimoreSarah Dallimore
Thanks. I am trying to download it and have installed and unzipped the folder but it is not loading (no error message). Do you have a link or recommendation of what Eclipse to download? Thanks for your help with this
Sarah DallimoreSarah Dallimore
Hi - I have now got Eclipse up and running. I have deleted the ChatterAnswersAuthProivderRegsitration.cls-meta.xml file and deployed it to production and it said successful however when I check production I can still see it. 

I am still getting the same error message when I use the app that is being blocked by Chatter ANswers (see below) - is there anyway around this? Thanks


ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [ProfileId]: [ProfileId] Class.ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser: line 31, column 1