• Admin User 8209
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
Hi Team,

We have a trigger on our production to find the duplicacy check. This trigger not working on our production but working on sandbox.
This trigger is used for our Address Book object. Where when we insert new data then this trigger is not working at that time means not cheking the duplicate record.
After check the duplicacy this trigger check the checkbox DuplicateEntry field.

Trigger Name - markDuplicate
Object - Address Book (New) LEX
Product - Sales
 
my controller class

public class AbSearchInVFController {
    public list <AddressBook__c> address {get;set;}
   public String searchKey {get;set;}
    public String blockKey {get;set;}
     public String areaKey {get;set;}
     public String buildingKey {get;set;}
       public Address add {get; set;}
     public Integer counter {get; set;}
     public AbSearchInVFController( ) {
    }
    public void search(){
        string searchquery='  select Name,Concerned_Person_Name__c,Company_Name__c ,Building_Name__c ,Location__c, Area_Occupied__c,'+
        'Block__c,Floor__c,Plot_Area__c,City__c,Unit_No__c,Concerned_Person_mobile__c,Remarks_By_Support_Staff__c,Remarks_By_Surveyor__c, State__c ,Createddate,CreatedById, OwnerId,lastModifiedById'+ 
        'from AddressBook__c'+
        'where  Location__c  like \'%'+searchkey+'%\''+
        'and Plot_Area__c like \'%'+areaKey+'%\''+
        'and Building_Name__c like \'%'+buildingKey+'%\''+
        'and block__c like \'%'+blockKey+'%\' Limit 100';
        address=Database.query(searchquery);
    } 
       public void clear(){
        address.clear();
    }
   
}



Test class.

@istest
public class AbSearchInVFControllerlTest{

   public static TestMethod void Test(){
    {
    Test.startTest();
     AddressBook__c  testaddress = new  AddressBook__c  (); 
     
    
     testaddress.Unit_No__c ='1';
        testaddress.Block__c ='A';
         testaddress.Concerned_Person_mobile__c ='9910008084';
            testaddress.Concerned_Person_Name__c ='mohan';
            testaddress.Floor__c ='1';
              testaddress.Building_Name__c ='buniyadt';
                testaddress.Company_Name__c ='bun';
                  testaddress.State__c='up';
                     testaddress.Location__c='18 sector';
                        testaddress.Area_Occupied__c='1000';
                           testaddress.City__c='Noida';
                           testaddress.Remarks_By_Support_Staff__c='Test';
                            testaddress.Remarks_By_Surveyor__c='Test';
                                           insert testaddress;
        
         
       ApexPages.StandardController controller = new ApexPages.StandardController(testaddress);
       
      Test.stopTest() ;     

    }
}
}

when i am deploing getting 0 % coverage 
we calculate achieved amount quarterly basis we have one object quarter second month child object on child object base monthly achieved amount , now we want to add all quaerterly basis month received amount to my quarter object .but it's not happening