+ Start a Discussion
sandeepathadusandeepathadu 

how to cover the else condition in test class

plz help me how to cover the else condition in salesforce

RaumilRaumil

Hello friend,

In first testmethod if yout "IF" condition matches criteria then it would be execute. For covering "else" condition you should write another testmethod in which the situtation should not satisfy "if" criteria hence automatically "Else" part would be executed.

 

Thank You

Hope this Helps

Raumil Setalwad

sandeepathadusandeepathadu

if i have 3 to 4 times of else conditions for one if then what i should do

RaumilRaumil

Yes if there is "else if" ladder then for each "else if" condition you hould specify different test class else your code will not be covered hundred percent.

 

Thank You

Raumil Setalwad

Shashikant SharmaShashikant Sharma

If you can share your class and testClass , it will be helpful to suggest you test case.

sandeepathadusandeepathadu

my class

public class Oppctrldelete
{
    decimal j = 0;

    public Oppctrldelete(ApexPages.StandardController controller) {


this.id =ApexPages.currentPage().getParameters().get('id');
op =[select id,name,Total_Invoiced__c,Total_Approved__c ,Billings_Indicator__c ,StageFilter__c,final_stage__c ,Quote_vs_Billings_Difference__c ,Filterstage__c,Total_Planned__c,Total_Submitted__c,ownerid,Purchase_order__c,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c from Opportunity where id=:id];

oli = [select id,Quantity,delete__c ,description,pricebookentry.name,UnitPrice,TotalPrice ,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid=:id ORDER BY Quantity];
if(op.StageFilter__c== 'Billing-Planned'){
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c,Filterstage__c from Opportunity where Header_Opportunity__c =:op.id ORDER BY closedate];
oppli = [select id,Line_Item_Total__c,Quantity,Quantity__c,PricebookEntryId,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps ORDER BY Quantity];
}
else if(op.StageFilter__c== 'Billing-Submitted'){
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c,Filterstage__c from Opportunity where Header_Opportunity__c =:op.id AND (stagename='Billing-Submitted' OR  stagename='Billing-Approved' OR  stagename='Billing-Invoiced') ORDER BY closedate];
oppli = [select id,Line_Item_Total__c,Quantity,Quantity__c,delete__c ,PricebookEntryId,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps ORDER BY Quantity];
}
else if(op.StageFilter__c== 'Billing-Approved'){
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c,Filterstage__c from Opportunity where Header_Opportunity__c =:op.id  AND  (stagename='Billing-Approved' OR stagename='Billing-Invoiced') ORDER BY closedate];
oppli = [select id,Line_Item_Total__c,PricebookEntryId ,Quantity,Quantity__c,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps ORDER BY Quantity];
}
else if(op.StageFilter__c== 'Billing-Invoiced'){
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c,Filterstage__c from Opportunity where Header_Opportunity__c =:op.id   AND  stagename='Billing-Invoiced' ORDER BY closedate];
oppli = [select id,Line_Item_Total__c,PricebookEntryId,Quantity,Quantity__c,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps ORDER BY Quantity];
}

 //opadd =[select id, MAX(CloseDate)   from Opportunity Limit 1 ];
//oppli = [select id,Line_Item_Total__c,Quantity,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps];
  Oppsnew = new List<Opportunity>();
  Opplinew = new List<Opportunitylineitem>();
   

   
    }
// Save The Updates on Opp and LineIems
   
    
   
    public PageReference save()    
     {
     try
     {     
   
         update oppli;
         oppli[0].Fire_Trigger__c = true;
         update Opps;
         //oli[0].Fire_Trigger__c = true;
         update oli;        
         update op;
       }
       
     catch(DmlException ex)
    {
        ApexPages.addMessages(ex);
        return null;
    }     
   return(new ApexPages.StandardController(Op)).view();  
    }


  // Cancel and go Back to Header Opportunity
   public PageReference cancel() 
    {
     return(new ApexPages.StandardController(Op)).view();
        return null;
    }
    
    
    public PageReference addmonthdyn()
     { 
    try
     {
     integer d;
     integer lkj = opps.size();
     integer poi = lkj-1;
 
     OpportunitylineItem[] oli = [select id,TotalPrice,ListPrice,PricebookEntry.name,Quantity,PricebookEntry.Product2.Name , PricebookEntry.Product2.id, UnitPrice,PricebookEntryId,Opportunityid,Quote_Original_List_Price__c  from OpportunityLineItem where Opportunityid=:id ORDER BY Quantity] ;
     opps[poi] =  [select id,Final_Stage__c ,Final_Closed_Date__c,stagename,Description,AccountId ,Hold_My_date__c,Week_End_Day__c ,name,closedate,Estimated_Start_Date__c from Opportunity where Header_Opportunity__c=:op.id ORDER BY closedate DESC LIMIT 1];
   
     Opportunity newopp= new Opportunity();
     newopp.stagename = 'Billing-Planned';
     newopp.Header_Opportunity__c=op.id;     
     newopp.recordtypeid='012M000000008mu';
     string mon;    
       
     decimal x = (poi+1*30);     
     newopp.Hold_My_date__c = opps[poi].closedate +x.intValue();
    
    // LitOrd.closedate = o.closedate;
    // for(Opportunity opps2:opps)
      //{
       //LitOrd.closedate = opps2.closedate+60; 
      // LitOrd.closedate = LitOrd.closedate+30; 
    // }
     newopp.closedate = opps[poi].closedate+30; 
    //LitOrd.closedate = opps[poi].closedate;   
   // Integer currentyear = opps[poi].Hold_My_date__c.year();
   // Integer currentMonth = (opps[poi].Hold_My_date__c.Month())+1;
       Integer currentyear =  newopp.Hold_My_date__c.year();
       Integer currentMonth =  newopp.Hold_My_date__c.Month();
        if(currentMonth==1){
          mon = 'JAN';
          
         
         }
         else if(currentMonth==2){
         mon = 'FEB';
         }
          else if(currentMonth==3){
         mon = 'MAR';
         }
          else if(currentMonth==4){
         mon = 'APR';
         }
          else if(currentMonth==5){
         mon = 'MAY';
         }
          else if(currentMonth==6){
         mon = 'JUN';
         }
          else if(currentMonth==7){
         mon = 'JUL';
         }
          else if(currentMonth==8){
         mon = 'AUG';
         }
          else if(currentMonth==9){
         mon = 'SEP';
         }
          else if(currentMonth==10){
         mon = 'OCT';
         }
          else if(currentMonth==11){
         mon = 'NOV';
         }
          else if(currentMonth==12){
         mon = 'DEC';
         }
        
      newopp.accountid = opps[poi].accountid;
      newopp.name = op.Account.name+'-'+op.Name+'-'+'Billing'+'-'+mon+'-'+ currentyear;
      
      newopp.final_stage__c ='Billing-Planned';
      newopp.probability =100;
      newopp.amount = 100;
     
      Oppsnew.add(newopp); 
      insert oppsnew;
    
    
   
  }
   catch(DmlException ex)
   {
     ApexPages.addMessages(ex);
     return null;
   }
   PageReference customPage = new PageReference('/apex/opptctldelete'); 
   customPage.getParameters().put('id', this.id);
   customPage.setRedirect(true);
   return customPage;
  
    }
    
   
    
   //Quick save changes
   public PageReference quicksave()
   {
     try
     {    
    

        update oppli;
        oppli[0].Fire_Trigger__c = true;
        update Opps;
        //oli[0].Fire_Trigger__c = true;
        update oli;        
        update op;
       
     
    
    }
    catch(DmlException ex)
    {
        ApexPages.addMessages(ex);
        return null;
    }
     
   PageReference customPage = new PageReference('/apex/opptctldelete');   
   customPage.getParameters().put('id', this.id);
   customPage.setRedirect(true);
   return customPage;             
    }   

  
    
   public List<Opportunity> Oppsnew  {get; set;} 
   public List<Opportunitylineitem> Opplinew  {get; set;} 
   public Opportunity Op ;
   public Opportunity opadd;
   public Opportunity[] Opps ;
   public OpportunitylineItem[] Oppli ;
   public OpportunitylineItem[] Oli ;
   public string id;
   decimal gtotal=0.0;
   decimal itotal=0;
   user u;
   decimal countindvidual;
   decimal actualcountindvidual;  
   decimal BItotal;
   decimal count = 0; 
   decimal finalBItotal =0;
   decimal counttotal = 0;
   decimal  totval;
   decimal childtot=0.0;

public String getname()
{
return 'Oppctrldelete';
}
public Opportunity getop()
{
return op;
}
public user getu()
{
return u;
}
public Opportunity [] getopps()
{

return opps;
}


 public PageReference filterstage()
  {
 update op;
   
  PageReference customPage = new PageReference('/apex/opptctldelete');   
  customPage.getParameters().put('id', this.id);
  customPage.setRedirect(true);
  return customPage; 
            
    }   



public OpportunitylineItem[] getoppli()
{

return oppli;
}
public OpportunitylineItem[] getoli()
{

return oli;
}

 
 
  public decimal gettotval()
 {
return totval;
}
public decimal getcountindvidual() {
return countindvidual;
}
 public decimal getgtotal()
 {
return gtotal;
} 
public decimal getBItotal()
 {
return BItotal;
} 
}
my test case i am getting 79 percent coverage with the test case
@isTest
private class Oppctrldelete_Test
{
static testmethod void MyTestController()
 {

        Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];

        Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true);
        insert pb;
        
        Product2 prod = new Product2(Name = 'Anti-infectives 2007', Family = 'Best Practices', IsActive = true);
        insert prod;

        PricebookEntry standardPrice = new PricebookEntry(Pricebook2Id = standardPB.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
        insert standardPrice;

        PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
        insert pbe;
         
 Account a = new Account();
 a.name = 'raja';
 insert a ;
 
  
 Opportunity opp = new Opportunity();
 opp.Name = 'raja';
 opp.StageName = 'Closedwon';
 opp.final_stage__c= 'Billing-Planned';
 opp.StageFilter__c = 'Billing-Submitted';
 
 opp.StageFilter__c = 'Billing-Planned';
 
 
 opp.CloseDate = date.ValueOf('2009-09-21');
 opp.Pricebook2Id = pb.id;
 opp.final_stage__c ='Billing-Invoiced';
 
 
 test.startTest();

 insert opp;
   
   test.stopTest();

   
   
   
   
   
   
     OpportunitylineItem opli = new OpportunitylineItem();
  opli.opportunityid=opp.id;
  opli.TotalPrice=5;
  opli.quantity=3;
  opli.PricebookEntryId = pbe.id; 
  
 insert opli;
     
   
   

      
 Opportunity opp1 = new Opportunity();
 opp1.Name = 'raj';
 opp1.StageName = 'Closedwon';
 opp1.StageFilter__c= 'Billing-Planned';
 opp1.CloseDate = date.ValueOf('2009-07-21');
 opp1.final_stage__c= 'Billing-Planned';
 opp1.Pricebook2Id = pb.id;
 opp1.header_opportunity__c = opp.id;
 insert opp1;
 
 
 
 
 
  
  OpportunitylineItem opli1 = new OpportunitylineItem();
  opli1.opportunityid=opp1.id;
  opli1.TotalPrice=56;
  opli1.quantity=33;
  opli1.PricebookEntryId = pbe.id; 
 opli1.delete__c=true;
  insert opli1;
  update opli;
    update opli1;
    
    
    
    
       
 ApexPages.currentPage().getParameters().put('id', opp.id);

 
 
 
  
 ApexPages.StandardController con = new ApexPages.StandardController(opp);
 Oppctrldelete o = new Oppctrldelete(con);
 
 
 PageReference pr2 = o.save();
 PageReference pr3 = o.addmonthdyn();
 PageReference pr4 = o.quicksave();
//  PageReference pr5 = o.testsave();
 o.getname();
 o.getopps();
 o.filterstage();
 o.getoppli();
 o.getop();
 O.getu();
 o.getoli();
 o.getcountindvidual();
 o.getgtotal();
 o.getBItotal();
 o.gettotval();
 o.cancel();
 //o.Addmonth();
// o.incrementCounter();
// o.quan();
 //o.childtotal();
// o.BI();
 //o.grandtotal();
  
  
 
 
 
  }
 }
i am getting 79 percent and the else conditions are not getting covered

 

 

sandeepathadusandeepathadu

this is my class

public class Create_Billings {

   
    public List<Opportunity> Opps  {get; set;}
    public List<OpportunitylineItem> Oppli  {get; set;}
    public  Opportunity [] op;
    public  Opportunitystage [] opstg;
    static Integer cnt2;
    
   
    string id;
    decimal i =0; 
    decimal j = 0;
  
    public Create_Billings (ApexPages.StandardController myController) 
    {
    this.id = ApexPages.currentPage().getParameters().get('id');
    //current page Opportunity and Opp Line Items and Price Book Entry ID

    Opportunity o =[select id,name,Final_Closed_Date__c,Week_End_Day__c,Estimated_Start_Date__c,Account.name,Year_of_close_date__c,Month_Of_Closedate__c,stagename,CloseDate,pricebook2id,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c from Opportunity where id=:id];
    OpportunitylineItem[] oli = [select id,TotalPrice,ListPrice,PricebookEntry.name,Quantity,PricebookEntry.Product2.Name , PricebookEntry.Product2.id, UnitPrice,PricebookEntryId,Opportunityid,Quote_Original_List_Price__c  from OpportunityLineItem where Opportunityid=:o.id] ;
    op=[select id,name,No_Of_Months_for_Billing__c,Estimated_Start_Date__c from Opportunity where id=:id];
   // opstg =[select id from Opportunitystage where id=:o.stagename];
   opstg =[select id from Opportunitystage where id='01J20000008ekm7'];
    system.debug('stage'+opstg[0].id);
    system.debug('hello'+oli[0].PricebookEntryId);
    
 
     i = o.No_Of_Months_for_Billing__c;
     Opps = new List<Opportunity>();
     Oppli =new List<OpportunitylineItem>();
    
     string mon;
     integer oi;
        
        for(i=0;i<o.No_Of_Months_for_Billing__c;i++)
        {
       
        Opportunity NewOpp = new Opportunity();
        
        NewOpp.stagename ='Billing-Planned';
      //  NewOpp.final_stage__c ='Billing-Planned';
        NewOpp.probability =100;
        NewOpp.amount = o.amount;
     
        decimal x = (i*30);
        NewOpp.Hold_My_date__c = o.Week_End_Day__c +x.intValue();
        
        NewOpp.closedate = o.closedate;
        NewOpp.recordtypeid='012M000000008mu';
       
        Integer currentyear = NewOpp.Hold_My_date__c.year();
        Integer currentMonth = NewOpp.Hold_My_date__c.Month();
        
        if(currentMonth==1){
          mon = 'JAN';
         
         }
         else if(currentMonth==2){
         mon = 'FEB';
         }
          else if(currentMonth==3){
         mon = 'MAR';
         }
          else if(currentMonth==4){
         mon = 'APR';
         }
          else if(currentMonth==5){
         mon = 'MAY';
         }
          else if(currentMonth==6){
         mon = 'JUN';
         }
          else if(currentMonth==7){
         mon = 'JUL';
         }
          else if(currentMonth==8){
         mon = 'AUG';
         }
          else if(currentMonth==9){
         mon = 'SEP';
         }
          else if(currentMonth==10){
         mon = 'OCT';
         }
          else if(currentMonth==11){
         mon = 'NOV';
         }
          else if(currentMonth==12){
         mon = 'DEC';
         }
         
         NewOpp.accountid = o.accountid;
         NewOpp.Header_Opportunity__c=o.id;
         
      
         NewOpp.name = o.Account.name+'-'+o.Name+'-'+'Billing'+'-'+mon+'-'+ currentyear;
         NewOpp.pricebook2id = o.pricebook2id;
      
         Opps.add(NewOpp);
         
          }
          
       integer r=0;
       for(j=0;j<((o.Opp_Line_Items_Count__c/oli.size())*o.No_Of_Months_for_Billing__c);j++){
        
       for(opportunitylineitem oli1:oli){

       OpportunitylineItem NewOppli= new OpportunitylineItem();
       decimal d=oli1.quantity/o.No_Of_Months_for_Billing__c;
       integer i9= Integer.valueOf(d);
       integer q=Integer.valueOf(o.No_Of_Months_for_Billing__c)*i9;
       decimal g=oli1.quantity-q;
       
       if(g == 0.0)
       {       
        NewOppli.quantity =i9;        
      }
               
         
        if(r<(o.No_Of_Months_for_Billing__c*o.Opp_Line_Items_Count__c)-o.Opp_Line_Items_Count__c)
            {
           NewOppli.quantity =i9;
          
           r++;
            }
            else{ 
            
             if(g == 0.0)
              {       
              NewOppli.quantity =i9;        
               }
             else
              {    
          
           NewOppli.quantity=i9+(oli1.quantity-q);
        
               }
      
           }
         NewOppli.unitprice = oli1.unitprice; 
         NewOppli.opportunityid = o.id;
         NewOppli.PricebookEntryId=oli1.PricebookEntryId;
         NewOppli.Product_Code__c = oli1.PricebookEntry.name;
         NewOppli.Quote_Original_Quantity__c = oli1.quantity;
         NewOppli.Quote_Original_Sale_Price__c = oli1.unitprice;
         NewOppli.Quote_Original_List_Price__c = oli1.unitprice;
         Oppli.add(NewOppli); 
         
        }
       }
    }   
     

   
   public PageReference Redirect() 
    {
   
   update op;   
   
   PageReference customPage = new PageReference('/apex/Create_Billings_Page'); 
 
   customPage.getParameters().put('id', this.id);
   customPage.setRedirect(true);
   return customPage;
    
    
    }
   public Opportunity [] getop()
{

return op;
}

    public PageReference save() 
    {
       
     try{   
   
         insert opps;
         
         Opportunity o =[select id,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c from Opportunity where id=:id];
         Integer cnt =0;
         integer cnt1;
         integer m;
         m = o.Opp_Line_Items_Count__c.intValue();                
                 
           for(cnt1=0;cnt1<o.Opp_Line_Items_Count__c*o.No_Of_Months_for_Billing__c;cnt1++)
          
           {
            Oppli[cnt1].Opportunityid=Opps[cnt].id;
           
            
             if(math.mod((cnt1+1),(m)) == 0 || o.Opp_Line_Items_Count__c == 1)
             {
             cnt = cnt + 1;
             }
           } 
         
          insert Oppli;
          o.StageFilter__c = 'Billing-Planned';
          update o;
        }    

      catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Oops An Error Occured!'));
      return null;
    } 
   
  PageReference customPage = new PageReference('/apex/Manage_Billings'); 


   customPage.getParameters().put('id', this.id);
    customPage.setRedirect(true);
    return customPage;
   
 }
 
  public PageReference updateoppli() 
    {
      // update opstg;
       update opps;
       update oppli;  
    return(new ApexPages.StandardController(Opps[0])).view();
    
    
    }
        
        }
this is my test case and i am getting 
System.NullPointerException: Attempt to de-reference a null object
Class.Create_Billings.<init>: line 105, column 58 Class.Create_BillingsTest.MyTestController: line 85, column 21 External entry point
test case
@isTest
private class Create_BillingsTest
{
static testmethod void MyTestController()
 {

        Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];

        Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true);
        insert pb;
        
        Product2 prod = new Product2(Name = 'Anti-infectives 2007', Family = 'Best Practices', IsActive = true);
        insert prod;

        PricebookEntry standardPrice = new PricebookEntry(Pricebook2Id = standardPB.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
        insert standardPrice;

        PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
        insert pbe;
         
 Account a = new Account();
 a.name = 'raja';
 insert a ;
 
  
 Opportunity opp = new Opportunity();
 opp.Name = 'raja';
 opp.StageName = 'Billing-Planned';
 opp.final_stage__c= 'Billing-Planned';
opp.No_Of_Months_for_Billing__c=1;
 
 opp.StageFilter__c = 'Billing-Planned';

 
 opp.CloseDate = date.ValueOf('2009-09-21');
 opp.Pricebook2Id = pb.id;
 opp.final_stage__c ='Billing-Invoiced';
 
 
 test.startTest();

 insert opp;
   
   test.stopTest();

 
   
     OpportunitylineItem opli = new OpportunitylineItem();
  opli.opportunityid=opp.id;
  opli.TotalPrice=5;
  opli.quantity=3;
  opli.Foraddingproduct__c = true;
  opli.PricebookEntryId = pbe.id; 
  insert opli;
     
  
 Opportunity opp1 = new Opportunity();
 opp1.Name = 'raj';
 opp1.No_Of_Months_for_Billing__c=1;
 opp1.StageName = 'Billing-Planned';
 opp1.StageFilter__c= 'Billing-Submitted';
 opp1.CloseDate = date.ValueOf('2009-07-21');
 opp1.final_stage__c= 'Billing-Planned';
 opp1.Pricebook2Id = pb.id;
 
 opp1.header_opportunity__c = opp.id;
 insert opp1;
 
  
  OpportunitylineItem opli1 = new OpportunitylineItem();
  opli1.opportunityid=opp1.id;
  opli1.TotalPrice=56;
  opli1.quantity=33;
  
  opli1.PricebookEntryId = pbe.id; 
 opli1.delete__c=true;
  insert opli1;
  update opli;
    update opli1;
  
       
 ApexPages.currentPage().getParameters().put('id', opp1.id);

 ApexPages.StandardController con = new ApexPages.StandardController(opp1);
Create_Billings o = new Create_Billings(con);
 
 PageReference pr2 = o.save();
 PageReference pr3 = o.updateoppli(); 
 PageReference pr4 = o.Redirect() ;
 o.getop();
 
  
  }
  
  
  
  
 }