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
sfdc sfdc 126sfdc sfdc 126 

unable to deploy my code in production getting dupecatcher testclass failed

 My problem is my apex classes and Test class have 80% code coverage but we have dupecather installed in our org so that dupecather test class is not allowing to deploy
Mahesh DMahesh D
What kind of error you are getting, can you paste the exact error message.
sfdc sfdc 126sfdc sfdc 126
System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: 
    SetupOwnerId duplicates value on record with id: 0000: [] Stack Trace:testclass: line 9, column 1
This test class is dupecatcher test class whic  have no acees to it 
Mahesh DMahesh D
Can you paste the dupecatcher test class.

Issue here is it is trying to create a duplicate record where the external unique id may be stopping it from creation.

Regards,
Mahesh
sfdc sfdc 126sfdc sfdc 126

isTest(seealldata=true)
public class CloneAccountsControllerTest {
   
    static testmethod void test (){
      AccountsContact__c accCon=new AccountsContact__c();
      //String pageId;
      accCon.Destination_Text__c='abc';
      accCon.Source_Text__c='test';
      insert accCon;
       Account acc=new Account();
      acc.name='XYZ';
      insert acc;
      Account acc1=new Account();
      acc1.name='XYZt';
      insert acc1;
      
      /*Account acc1=new Account();
      acc1.name='XYZ12';
      insert acc1;*/
      
      Contact con=new Contact();
      con.Accountid=acc.id;
      con.firstname='first';
      con.lastname='last';
      insert con;  
     
      //pageId=Apexpages.currentPage().getParameters().put('id',acc.id);
      
      List<account> accounts=new List<account>();
      //accounts.add(acc);
      //accounts.add(acc1); 
      accounts.add(acc);
      //accounts.setselected()
     // insert accounts;
      //set<String> selectedid=new set<String>();
      //selectedid.add(acc.id);
     ApexPages.StandardSetController stdController = new ApexPages.StandardSetController(accounts);
     stdController.setselected(accounts);
     //accounts=stdController.getSelected();
      CloneAccountsController cloneAccCon=new CloneAccountsController(stdController);
      //cloneAccCon.objs.add(acc);
      cloneAccCon.insertdata();
      }
Mahesh DMahesh D
Remove the SeeAllData=true and try it.