• Tashika Gupta
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies

I am creating a vf page in which wat i want is to change the data type of my custom feild from text area to rich text area on onclick event when
i click on image(which edit my records) and again when i save it it get converted into text area
Please help me out.

Thank in advance!!!

the portion with bold are not covered
here is my trigger:

/**
    Description : Calculate the weekending date and reporting month to be shown in GRN report
    Test Class  :
**/
/*
    Created By : Binit Ranjan
    Created On : 19/3/2013
*/

trigger tRIIO_POS_Invoice_UpdateReportMonth on tRIIO_PO_Invoice_Queries__c (Before Update,Before Insert) {

    Map<Id,Date> MapGetWeek=new Map<Id,date>();
    Map<Id,Date> MapGetNew =new Map<Id,date>();
    Map<Id,Date> MapGetOld=new Map<Id,date>();
    Map<Id,String> MapGetMonth=new Map<Id,String>();
    Map<Id,Date> MapGetFC=new Map<Id,Date>();
    Map<Id,String> MapGetFCC=new Map<Id,String>();
    list<id> lstAllNGAWeekIds =new list<id>();
    list<id> lstAllFCIds =new list<id>();
    list<Date> lstAllWeekIds =new list<Date>();
    
    For(tRIIO_PO_Invoice_Queries__c PRNew : trigger.New){
        MapGetNew.put(PRNew.Id, PRNew.Weekending__c);
        lstAllWeekIds.add(PRNew.Weekending__c);
    }    
       for(Week__c WeekData : [Select id, Name,h_Weekending__c,Reporting_Month__c from Week__c where h_Weekending__c in: lstAllWeekIds]){
           MapGetWeek.Put(WeekData.Id,WeekData.h_Weekending__c);
           MapGetMonth.Put(WeekData.Id,WeekData.Reporting_Month__c);
           lstAllNGAWeekIds.add(WeekData.id);

       }
        for(tRIIO_POS_Financial_Calendar__c FC : [Select id,Week_Commencing__c,Period_Number__c from tRIIO_POS_Financial_Calendar__c ]){
            MapGetFC.Put(FC.Id,FC.Week_Commencing__c);
            MapGetFCC.Put(FC.Id,FC.Period_Number__c);
            lstAllFCIds.add(FC.id);

        }

        for(tRIIO_PO_Invoice_Queries__c PR : Trigger.New)
        {
              For(Id WeekId :lstAllNGAWeekIds ){           
                if((MapGetWeek.get(WeekId))!= Null){
                    if(Date.valueof(PR.Weekending__c)== MapGetWeek.get(WeekId)){
                        PR.Reporting_Month__c = MapGetMonth.get(WeekId);
                        break;

                    }
                }
               }
               For(Id FIC:lstAllFCIds){           
                   if(MapGetFC.get(FIC)!=Null){
                     if(PR.Weekending__c == MapGetFC.get(FIC)){   
                       PR.h_FinancialPeriodNo__c = MapGetFCC.get(FIC);
                       break;

                     }
                   }  
               }    
             
               PR.h_WeekEnding__c = PR.Weekending__c;
               
        }
 }


here is my test class:

@istest
public class tRIIO_POS_Invoice_UpdateReportMonth_Test {
    public static testmethod void myUnitTest(){
        
          try{
                     
        
        
        tRIIO_Contract__c contract = new tRIIO_Contract__c (name = '1111', Description__c = 'Test Contract XXX');
        insert contract;
              
        tRIIO_POS_Supplier__c TestSupplier= new tRIIO_POS_Supplier__c(status__c = 'Approved',Approval_Date__c = system.today());
        insert TestSupplier;
             
        tRIIO_Purchasing_Depot__c Testdepot = new tRIIO_Purchasing_Depot__c (name = 'Depot1', Locality__c = '33', Location__c = 'XXXX', Town__c = 'Ars',
                                                                           County__c = 'test',  Phone_Number__c = '12345' );
        insert Testdepot;   
           
        triio_Personnel__c personnel = new triio_Personnel__c(name = 'xxxxyy');                                                    
        insert personnel;
              
        tRIIO_POS_Supplier_Rate__c ObjPOSSupplierRate = new tRIIO_POS_Supplier_Rate__c( Item_Description__c='abcd',Item_Short_Description__c='xyz',Unit__c='LOAD',Supplier__c=TestSupplier.ID);
        insert  ObjPOSSupplierRate;
              
      
        triio_pos_Agent__c TestAgent= new triio_pos_Agent__c();
        TestAgent.Employee_Display_Name__c = personnel.Id;
        insert TestAgent;  
      
        
        tRIIO_POS_Purchase_Order_Header__c purchasing = new tRIIO_POS_Purchase_Order_Header__c ( Contract__c = contract.id,
                                Depot__c = Testdepot.id,                                
                                Supplier__c = TestSupplier.id,
                                Order_to_Collect__c = true,
                                Requested_By_Project_Manager__c = TestAgent.id,
                                Deliver_to__c = 'My Delivery',
                                Order_Date__c = system.today(),
                                Required_Delivery_Date__c = system.today() ,Status__c='PO Items Raised');
        insert purchasing ;
      
        
        tRIIO_POS_Purchase_Order_Header__c purchaseHeader = [SELECT ID, Status__c FROM tRIIO_POS_Purchase_Order_Header__c WHERE id =:purchasing.id];
        system.assert(purchaseHeader.Status__c=='PO Items Raised');
        
         

        tRIIO_POS_Purchase_Order_Item__c ObjPOSPurchaseOrderItm = new tRIIO_POS_Purchase_Order_Item__c (Supplier_Rates__c=ObjPOSSupplierRate.id,Order_Qty__c=10.00,Ordered_Price__c=20.00,Purchasing__c=purchasing.ID);
        insert ObjPOSPurchaseOrderItm;
     
       
        tRIIO_PO_Invoice_Queries__c purchaseInvoice = new tRIIO_PO_Invoice_Queries__c(Purchasing_Items__c =ObjPOSPurchaseOrderItm.id,
        Q_Number__c='Q123456',Quantity__c=10.00,Rate_Price__c=10,Query_Dates__c=system.today());
        insert purchaseInvoice ;
         
        tRIIO_PO_Invoice_Queries__c purchaseInvoice1 =[select Weekending__c from tRIIO_PO_Invoice_Queries__c where  id =:purchaseInvoice.Id];
       
         
                    
        Week__c WK = new Week__c(name='03 May 13',Reporting_Month__c='May 13',h_Weekending__c=purchaseInvoice1.Weekending__c);
        insert WK;
        system.assertEquals(purchaseInvoice1.Weekending__c, WK.h_Weekending__c);
     
                     
       Week__c WK1 =[select id,name,Reporting_Month__c,h_Weekending__c from Week__c where id=:WK.Id];
              system.debug(WK1);
              
       tRIIO_POS_Financial_Calendar__c ObjPOSFinanceCal = new tRIIO_POS_Financial_Calendar__c(Week_Commencing__c=system.today(),Period_Number__c='1234');
              insert ObjPOSFinanceCal;
          }
       
 catch(exception e){
        }
    }

}
here is my class


global class BT_Invoicing_New_Override_Crtl {

    public ApexPages.StandardController stdCon;
    public BT_Invoicing__c btinvoice{get;set;}
    public Static Integer BtjoblstSize;
    public Double Local_DFE_Quantity;
    public Double Local_Invoice_Cost_excl_vat;
    public String recordId;
    BT_Invoicing__c btinvoiceRecord;
    Public Static String btEstimateNumber;

    public BT_Invoicing_New_Override_Crtl(ApexPages.StandardController controller) 
    {
        stdCon= controller;
        btinvoice= (BT_Invoicing__c)stdCon.getRecord();
        recordId=ApexPages.currentPage().getParameters().get('id');
    } 
   
    public PageReference Save(){
    try{

        btinvoiceRecord= (BT_Invoicing__c)stdCon.getRecord();
       
        
            if(btinvoiceRecord.Invoice_Cost_excl_vat__c==null)
            Local_Invoice_Cost_excl_vat=0;
         else
            Local_Invoice_Cost_excl_vat=btinvoiceRecord.Invoice_Cost_excl_vat__c;
            
          if(btinvoiceRecord.DFE_Quantity__c==null)
             Local_DFE_Quantity=0;
          else
              Local_DFE_Quantity=btinvoiceRecord.DFE_Quantity__c;
            
     if(btinvoiceRecord.Pay__c=='Yes'&& ( Local_Invoice_Cost_excl_vat- Local_DFE_Quantity > 0)
                                         && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='PAID-DFE';
     else if(btinvoiceRecord.Pay__c=='Yes'&& (Local_Invoice_Cost_excl_vat- Local_DFE_Quantity==0) 
                                         && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='Paid';
     else if(btinvoiceRecord.Pay__c=='No' && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='Active';
        
     
        
        upsert btinvoicerecord;
                
        PageReference pageref = new Pagereference('/'+btinvoicerecord.id);
        pageref.setRedirect(true);
        return pageref;
        
        return null;
      }
    catch(Exception ex){
        ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR,ex.getDMLMessage(0));
        ApexPages.addMessage(msg);
        return null;
    }    
  }
  
  public PageReference SaveandNew(){
    try{
        stdCon.Save();  
        return new PageReference('/'+stdCon.getRecord().getSObjectType().getDescribe().getKeyPrefix()+'/e?');
         
      }
    catch(Exception ex){
        ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR,ex.getDMLMessage(0));
        ApexPages.addMessage(msg);
        return null;
    }    
  
  }
  
  @RemoteAction
 Public Static Integer GetEstimateListsize(String btestimateno)
  {
         List<BT_Job__c> Btjoblst=[Select Id,Name,Estimate_No__c From BT_Job__c Where  Estimate_No__c=:btestimateno];
         BtjoblstSize=Btjoblst.size();
         System.debug('BtjoblstSize='+BtjoblstSize);
         return BtjoblstSize;
  }
  
   
}

n this is my test class

@istest
public class BT_Invoicing_New_Override_Crtl_Test {
    
     public static testmethod void myTestUnit1(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=55.20;
        btInvObj.DFE_Quantity__c=45.30;
        btInvObj.Pay__c='Yes';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        
        insert btInvObj;
         
          ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
     public static testmethod void myTestUnit2(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=45.30;
        btInvObj.DFE_Quantity__c=45.30;
        btInvObj.Pay__c='Yes';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
         
         
     
         ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
     public static testmethod void myTestUnit3(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=00.00;
        btInvObj.DFE_Quantity__c=00.00;
        btInvObj.Pay__c='No';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
         
         
    
         ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
    public static testmethod void myTestUnit4(){
      
       
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=10.00;
        btInvObj.DFE_Quantity__c=10.00;
        btInvObj.Pay__c='No';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
       BT_Invoicing__c btInvObj1=[select id , Invoice_Status__c from  BT_Invoicing__c where id=:btInvObj.id];
       
        PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        Test.startTest();
      
      ApexPages.StandardController sc = new ApexPages.standardController(btInvObj1);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.SaveandNew();
      
        

       }
}

I need to increase the code coverage ,its nt covering remote action method and catch block
please help me out
i have a custom feilds called product codes on opportunity.Whenever opportunity product is added to Opportunity,'Product Codes' field value should be appended with the product code of that opportunity product. 


how to implement this through triggers,please help me out
i have a custom checkbox feild called recovered on account.Whenver the record is recovered from recycle bin i want that the recovered feild should be checked.

I want to implement this through trigger. how can i do this ???
 
have an object in which have two feilds status and targeted date . i have to send an email alert to the user when the status feild is work in progress daily till targeted date .
how can imimlpement this 

I am creating a vf page in which wat i want is to change the data type of my custom feild from text area to rich text area on onclick event when
i click on image(which edit my records) and again when i save it it get converted into text area
Please help me out.

Thank in advance!!!

the portion with bold are not covered
here is my trigger:

/**
    Description : Calculate the weekending date and reporting month to be shown in GRN report
    Test Class  :
**/
/*
    Created By : Binit Ranjan
    Created On : 19/3/2013
*/

trigger tRIIO_POS_Invoice_UpdateReportMonth on tRIIO_PO_Invoice_Queries__c (Before Update,Before Insert) {

    Map<Id,Date> MapGetWeek=new Map<Id,date>();
    Map<Id,Date> MapGetNew =new Map<Id,date>();
    Map<Id,Date> MapGetOld=new Map<Id,date>();
    Map<Id,String> MapGetMonth=new Map<Id,String>();
    Map<Id,Date> MapGetFC=new Map<Id,Date>();
    Map<Id,String> MapGetFCC=new Map<Id,String>();
    list<id> lstAllNGAWeekIds =new list<id>();
    list<id> lstAllFCIds =new list<id>();
    list<Date> lstAllWeekIds =new list<Date>();
    
    For(tRIIO_PO_Invoice_Queries__c PRNew : trigger.New){
        MapGetNew.put(PRNew.Id, PRNew.Weekending__c);
        lstAllWeekIds.add(PRNew.Weekending__c);
    }    
       for(Week__c WeekData : [Select id, Name,h_Weekending__c,Reporting_Month__c from Week__c where h_Weekending__c in: lstAllWeekIds]){
           MapGetWeek.Put(WeekData.Id,WeekData.h_Weekending__c);
           MapGetMonth.Put(WeekData.Id,WeekData.Reporting_Month__c);
           lstAllNGAWeekIds.add(WeekData.id);

       }
        for(tRIIO_POS_Financial_Calendar__c FC : [Select id,Week_Commencing__c,Period_Number__c from tRIIO_POS_Financial_Calendar__c ]){
            MapGetFC.Put(FC.Id,FC.Week_Commencing__c);
            MapGetFCC.Put(FC.Id,FC.Period_Number__c);
            lstAllFCIds.add(FC.id);

        }

        for(tRIIO_PO_Invoice_Queries__c PR : Trigger.New)
        {
              For(Id WeekId :lstAllNGAWeekIds ){           
                if((MapGetWeek.get(WeekId))!= Null){
                    if(Date.valueof(PR.Weekending__c)== MapGetWeek.get(WeekId)){
                        PR.Reporting_Month__c = MapGetMonth.get(WeekId);
                        break;

                    }
                }
               }
               For(Id FIC:lstAllFCIds){           
                   if(MapGetFC.get(FIC)!=Null){
                     if(PR.Weekending__c == MapGetFC.get(FIC)){   
                       PR.h_FinancialPeriodNo__c = MapGetFCC.get(FIC);
                       break;

                     }
                   }  
               }    
             
               PR.h_WeekEnding__c = PR.Weekending__c;
               
        }
 }


here is my test class:

@istest
public class tRIIO_POS_Invoice_UpdateReportMonth_Test {
    public static testmethod void myUnitTest(){
        
          try{
                     
        
        
        tRIIO_Contract__c contract = new tRIIO_Contract__c (name = '1111', Description__c = 'Test Contract XXX');
        insert contract;
              
        tRIIO_POS_Supplier__c TestSupplier= new tRIIO_POS_Supplier__c(status__c = 'Approved',Approval_Date__c = system.today());
        insert TestSupplier;
             
        tRIIO_Purchasing_Depot__c Testdepot = new tRIIO_Purchasing_Depot__c (name = 'Depot1', Locality__c = '33', Location__c = 'XXXX', Town__c = 'Ars',
                                                                           County__c = 'test',  Phone_Number__c = '12345' );
        insert Testdepot;   
           
        triio_Personnel__c personnel = new triio_Personnel__c(name = 'xxxxyy');                                                    
        insert personnel;
              
        tRIIO_POS_Supplier_Rate__c ObjPOSSupplierRate = new tRIIO_POS_Supplier_Rate__c( Item_Description__c='abcd',Item_Short_Description__c='xyz',Unit__c='LOAD',Supplier__c=TestSupplier.ID);
        insert  ObjPOSSupplierRate;
              
      
        triio_pos_Agent__c TestAgent= new triio_pos_Agent__c();
        TestAgent.Employee_Display_Name__c = personnel.Id;
        insert TestAgent;  
      
        
        tRIIO_POS_Purchase_Order_Header__c purchasing = new tRIIO_POS_Purchase_Order_Header__c ( Contract__c = contract.id,
                                Depot__c = Testdepot.id,                                
                                Supplier__c = TestSupplier.id,
                                Order_to_Collect__c = true,
                                Requested_By_Project_Manager__c = TestAgent.id,
                                Deliver_to__c = 'My Delivery',
                                Order_Date__c = system.today(),
                                Required_Delivery_Date__c = system.today() ,Status__c='PO Items Raised');
        insert purchasing ;
      
        
        tRIIO_POS_Purchase_Order_Header__c purchaseHeader = [SELECT ID, Status__c FROM tRIIO_POS_Purchase_Order_Header__c WHERE id =:purchasing.id];
        system.assert(purchaseHeader.Status__c=='PO Items Raised');
        
         

        tRIIO_POS_Purchase_Order_Item__c ObjPOSPurchaseOrderItm = new tRIIO_POS_Purchase_Order_Item__c (Supplier_Rates__c=ObjPOSSupplierRate.id,Order_Qty__c=10.00,Ordered_Price__c=20.00,Purchasing__c=purchasing.ID);
        insert ObjPOSPurchaseOrderItm;
     
       
        tRIIO_PO_Invoice_Queries__c purchaseInvoice = new tRIIO_PO_Invoice_Queries__c(Purchasing_Items__c =ObjPOSPurchaseOrderItm.id,
        Q_Number__c='Q123456',Quantity__c=10.00,Rate_Price__c=10,Query_Dates__c=system.today());
        insert purchaseInvoice ;
         
        tRIIO_PO_Invoice_Queries__c purchaseInvoice1 =[select Weekending__c from tRIIO_PO_Invoice_Queries__c where  id =:purchaseInvoice.Id];
       
         
                    
        Week__c WK = new Week__c(name='03 May 13',Reporting_Month__c='May 13',h_Weekending__c=purchaseInvoice1.Weekending__c);
        insert WK;
        system.assertEquals(purchaseInvoice1.Weekending__c, WK.h_Weekending__c);
     
                     
       Week__c WK1 =[select id,name,Reporting_Month__c,h_Weekending__c from Week__c where id=:WK.Id];
              system.debug(WK1);
              
       tRIIO_POS_Financial_Calendar__c ObjPOSFinanceCal = new tRIIO_POS_Financial_Calendar__c(Week_Commencing__c=system.today(),Period_Number__c='1234');
              insert ObjPOSFinanceCal;
          }
       
 catch(exception e){
        }
    }

}
here is my class


global class BT_Invoicing_New_Override_Crtl {

    public ApexPages.StandardController stdCon;
    public BT_Invoicing__c btinvoice{get;set;}
    public Static Integer BtjoblstSize;
    public Double Local_DFE_Quantity;
    public Double Local_Invoice_Cost_excl_vat;
    public String recordId;
    BT_Invoicing__c btinvoiceRecord;
    Public Static String btEstimateNumber;

    public BT_Invoicing_New_Override_Crtl(ApexPages.StandardController controller) 
    {
        stdCon= controller;
        btinvoice= (BT_Invoicing__c)stdCon.getRecord();
        recordId=ApexPages.currentPage().getParameters().get('id');
    } 
   
    public PageReference Save(){
    try{

        btinvoiceRecord= (BT_Invoicing__c)stdCon.getRecord();
       
        
            if(btinvoiceRecord.Invoice_Cost_excl_vat__c==null)
            Local_Invoice_Cost_excl_vat=0;
         else
            Local_Invoice_Cost_excl_vat=btinvoiceRecord.Invoice_Cost_excl_vat__c;
            
          if(btinvoiceRecord.DFE_Quantity__c==null)
             Local_DFE_Quantity=0;
          else
              Local_DFE_Quantity=btinvoiceRecord.DFE_Quantity__c;
            
     if(btinvoiceRecord.Pay__c=='Yes'&& ( Local_Invoice_Cost_excl_vat- Local_DFE_Quantity > 0)
                                         && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='PAID-DFE';
     else if(btinvoiceRecord.Pay__c=='Yes'&& (Local_Invoice_Cost_excl_vat- Local_DFE_Quantity==0) 
                                         && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='Paid';
     else if(btinvoiceRecord.Pay__c=='No' && btinvoiceRecord.Reject_Invoice__c==false && btinvoiceRecord.Invoice_In_Query__c==false)
          btinvoiceRecord.Invoice_Status__c='Active';
        
     
        
        upsert btinvoicerecord;
                
        PageReference pageref = new Pagereference('/'+btinvoicerecord.id);
        pageref.setRedirect(true);
        return pageref;
        
        return null;
      }
    catch(Exception ex){
        ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR,ex.getDMLMessage(0));
        ApexPages.addMessage(msg);
        return null;
    }    
  }
  
  public PageReference SaveandNew(){
    try{
        stdCon.Save();  
        return new PageReference('/'+stdCon.getRecord().getSObjectType().getDescribe().getKeyPrefix()+'/e?');
         
      }
    catch(Exception ex){
        ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR,ex.getDMLMessage(0));
        ApexPages.addMessage(msg);
        return null;
    }    
  
  }
  
  @RemoteAction
 Public Static Integer GetEstimateListsize(String btestimateno)
  {
         List<BT_Job__c> Btjoblst=[Select Id,Name,Estimate_No__c From BT_Job__c Where  Estimate_No__c=:btestimateno];
         BtjoblstSize=Btjoblst.size();
         System.debug('BtjoblstSize='+BtjoblstSize);
         return BtjoblstSize;
  }
  
   
}

n this is my test class

@istest
public class BT_Invoicing_New_Override_Crtl_Test {
    
     public static testmethod void myTestUnit1(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=55.20;
        btInvObj.DFE_Quantity__c=45.30;
        btInvObj.Pay__c='Yes';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        
        insert btInvObj;
         
          ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
     public static testmethod void myTestUnit2(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=45.30;
        btInvObj.DFE_Quantity__c=45.30;
        btInvObj.Pay__c='Yes';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
         
         
     
         ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
     public static testmethod void myTestUnit3(){
      PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=00.00;
        btInvObj.DFE_Quantity__c=00.00;
        btInvObj.Pay__c='No';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
         
         
    
         ApexPages.StandardController sc = new ApexPages.standardController(btInvObj);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.Save(); 
     } 
    public static testmethod void myTestUnit4(){
      
       
        BT_Invoicing__c btInvObj = new BT_Invoicing__c();
        btInvObj.Invoice_Cost_excl_vat__c=10.00;
        btInvObj.DFE_Quantity__c=10.00;
        btInvObj.Pay__c='No';
        btInvObj.Reject_Invoice__c=false;
        btInvObj.Invoice_In_Query__c=false;
        insert btInvObj;
       BT_Invoicing__c btInvObj1=[select id , Invoice_Status__c from  BT_Invoicing__c where id=:btInvObj.id];
       
        PageReference pageRef = Page.BT_Invoicing_New_Override;
        Test.setCurrentPage(pageRef);
        Test.startTest();
      
      ApexPages.StandardController sc = new ApexPages.standardController(btInvObj1);
       BT_Invoicing_New_Override_Crtl sic = new  BT_Invoicing_New_Override_Crtl(sc);
      sic.SaveandNew();
      
        

       }
}

I need to increase the code coverage ,its nt covering remote action method and catch block
please help me out
i have a custom checkbox feild called recovered on account.Whenver the record is recovered from recycle bin i want that the recovered feild should be checked.

I want to implement this through trigger. how can i do this ???
 
have an object in which have two feilds status and targeted date . i have to send an email alert to the user when the status feild is work in progress daily till targeted date .
how can imimlpement this