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
Adam RycroftAdam Rycroft 

HELP - apex code error ChatterAnswersAuthProviderRegTest

I'm trying to deploy apex code changes to production and I keep getting the same error. "ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser(), Details: 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 do not use Chatter Answers nor will we ever. We I try to disable them, I get the following error:
Error: You can't disable Chatter Answers if your records have any references to questions or replies from any application customizations, including: formula fields, triggers, workflow rules, and approval processes. You must remove these references before you can disable Chatter Answers: Workflow Rule: chatter_answers_num_subscriptions_above_limit_wf, Apex Class: ChatterAnswersEscalationTriggerTest, Workflow Rule: chatter_answers_no_best_reply_within_time_limit_wf, Workflow Field Update: X01R31000000Upij

I deactivated the two workflows and still cannot disable it.

I've read through the other threads on this and tried changing the code of ChatterAnswersAuthProviderRegTest to
@isTest
private class ChatterAnswersAuthProviderRegTest {
 static testMethod void validateCreateUpdateUser() {   
 }
}

When I try updating this apex code, I get a code coverage failure message.

What else can be done? We will never use Chatter Answers - is there a way just to eliminate this or set the profileID to some arbitrary value?
Felix van Hove 9Felix van Hove 9
Sorry, if the answer is late: Disabling items might not be enough. Why not delete them as described here: http://help.salesforce.com/articleView?id=000181537&language=en_US&type=1