Skip to main content
Kim Roberts (PrismHR) ha preguntado en #Apex
Hi - I am over my head here trying to inactivate this trigger that is no longer working.  It cannot be moved in a change set as we keep getting errors that we have zero code coverage.  We do not have a developer resource at our company.  It was created by a consultant and slowly starting to fail.  One thing I noticed in the Error Messages (we have 17) is that 7 of them state the same/similar thing:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, To create or update users for this profile, go to Setup > Communities Settings and select Allow using standard external profiles for self-registration and user creation.: [ProfileId]

And then the classes:

Stack Trace: Class.UFeedCommentTest.testFeedCommentCustomerCommunityLoginUser: line 14, column 1

Stack Trace: Class.ContactUserSyncServicesTest.setUpCS: line 26, column 1

Another 6 also have very similar error messages:

System.DmlException: SObjectFactory Create failed. State: {"Count":"1","Template":"Community_User","SObjectType":"User"}, Cause: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, To create or update users for this profile, go to Setup > Communities Settings and select Allow using standard external profiles for self-registration and user creation.: [ProfileId]

Stack Trace: Class.SObjectFactory.create: line 126, column 1 Class.SObjectBuilder.create: line 129, column 1 Class.WebhookResourceTest.setupCommunityUser: line 57, column 1

Is there any chance there is a "simple" fix to all of these since it is the same errors?  Here is the code from the first class getting the error on line 26:

I need to inactivate a trigger but get a zero code coverage error when validating the change set.

Thanks in advance!
11 respuestas
  1. 8 jul 2020, 14:49
    It does not seem this is a trigger issue. It is a profile issue for self registered user creation.

    The error message indicates how to fix this issue:

    Go to Setup > Communities Settings and select Allow using standard external profiles for self-registration and user creation

    Use the following screen shot to setup right Profile on the community.

    I think "Allow external users to self-register" should have already been checked.

    It does not seem this is a trigger issue. It is a profile issue for self registered user creation.

     
0/9000