• Harjeet Singh
  • NEWBIE
  • 60 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 46
    Questions
  • 64
    Replies
Hi All,

I am working on a proposal and thinking of giving a good business solution which leads to increase revenue/less cost for business.
Requirement is like:
Suppose there are around 500 permission set in system which are used by different stakeholders and among 500 permission set say around 200 permission sets are used by core SFDC team.
Let all the 200 SFDC permission set starts with PS as PS_PS1,PS_PS2,..etc.
In a way its very difficult to manage all the permission set in system along with other stakeholder's permission set

My idea is to provide a generalised Dashboard view to client where they can view the permission set associated with SFDC i.e. permission set started with PS_XXX1,PS_XXX2 so on.

Is this possible to achieve this. What are the pain areas in order to achieve this.

Please guide me and provides the good approach to achieve this solution. This will be really very helpful for any client in their business.

​Many thanks in advance
I am working on a proposal and thinking of giving a good business solution which leads to increase revenue/less cost for business.
Requirement is like:
Suppose there are around 500 permission set in system which are used by different stakeholders and among 500 permission set say around 200 permission sets are used by core SFDC team.
Let all the 200 SFDC permission set starts with PS as PS_PS1,PS_PS2,..etc.
In a way its very difficult to manage all the permission set in system along with other stakeholder's permission set

My idea is to provide a generalised Dashboard view to client where they can view the permission set associated with SFDC i.e. permission set started with PS_XXX1,PS_XXX2 so on.

Is this possible to achieve this. What are the pain areas in order to achieve this.

Please guide me and provides the good approach to achieve this solution. This will be really very helpful for any client in their business.

​Many thanks in advance
Hi All,

I am working on a proposal and thinking of giving a good business solution which leads to increase revenue/less cost for business.
Requirement is like:
Suppose there are around 500 permission set in system which are used by different stakeholders and among 500 permission set say around 200 permission sets are used by core SFDC team.
Let all the 200 SFDC permission set starts with PS as PS_PS1,PS_PS2,..etc.
In a way its very difficult to manage all the permission set in system along with other stakeholder's permission set

My idea is to provide a generalised Dashboard view to client where they can view the permission set associated with SFDC i.e. permission set started with PS_XXX1,PS_XXX2 so on.

Is this possible to achieve this. What are the pain areas in order to achieve this.

Please guide me and provides the good approach to achieve this solution. This will be really very helpful for any client in their business.

Many thanks in advance
Hi all,
i have a requirement -  a Campaign / Contact / Leads / Users related Report is run time to time.
Then that Report is to be assigned to Campaign via Lookup later….
 Is there a way this can be automated through one of the below option:
1.Can I use Process builder to automate below steps?
2.Can I use Macros ?
3.Can I use Selenium tool ?
4.Can I write Apex batch programs ? Apex class ?
5. Can I use combination of above steps ?

If yes,please give some details on the process.

​Many thanks in advance.
Hi all,
i have a requirement -  a Campaign / Contact / Leads / Users related Report is run time to time.
Then that Report is to be assigned to Campaign via Lookup later….
 Is there a way this can be automated through one of the below option:
1.Can I use Process builder to automate below steps?
2.Can I use Macros ?
3.Can I use Selenium tool ?
4.Can I write Apex batch programs ? Apex class ?
5. Can I use combination of above steps ?

If yes,please give some details on the process.

Many thanks in advance.
Hi All,

I am working on a test class for a class which was created by me nut unfortunately i am not able to increase the code coverage beyond 67%.
P.F.A the controller and test class.
public with sharing class TfB_PB_AccountActionsWrapper{
       
    public List<wrapSubscription> SubscriptionSetList{get;set;}
    public integer size{get;set;}
    public Date currentDateValue { get; set; }
    public String selectedActions{get;set;}
    public csord__Subscription__c vSub{get;set;}
    public List<csord__Subscription__c> vLstSub{get;set;}
    public Map<Id, List<csord__Subscription__c>> AccIdSubListMap { get; set; }
    public Opportunity oppList;
    public Map<Id, List<csord__Service__c>> SubIdServListMap { get; set; }
    Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public boolean AccountBool{get;set;}
    public boolean fals{get;set;}
    public Date SysDate{get;set;}
    public Account vAccount{get;set;}
    public Account vSourceAccount{get;set;}
    public String contextItem{get;set;}
    public integer noOfRecords{get;set;}
    public set<csord__Subscription__c > selectedSubscription;
    public List<csord__Subscription__c > selectedSubscriptionList;
    public set<id> subids;
    public Id OpptyId;
    public string accountId;
    public String baseQuery;
    
    //Constructor for the class    
    public TfB_PB_AccountActionsWrapper( ){
       
        AccIdSubListMap=new Map<Id, List<csord__Subscription__c>>();
        SubIdServListMap= new Map<Id, List<csord__Service__c>>();
        
        vSub= new csord__Subscription__c();
        selectedActions='Takeover';
        if(selectedActions=='Takeover'){
            AccountBool=true; 
        }
        fals= false; 
        this.subids = new set<id>();
        selectedSubscriptionList = new List<csord__Subscription__c >(); 
        this.selectedSubscription = new set<csord__Subscription__c>();
        SubscriptionSetList = new List<wrapSubscription>();
        accountId=ApexPages.currentPage().getParameters().get('id');      
    }
    
    //Following property will pick values from the custom setting
        public List<selectOption> ActionValues {
        get {
          List<selectOption> options = new List<selectOption>();
    
          for (TfB_PB_ChangeType__c cType : TfB_PB_ChangeType__c.getAll().values())
          
            options.add(new SelectOption(cType.Name,cType.Name));
          return options;
        }
        set;
      }
    
    //This function implements the pagination logic
    public ApexPages.StandardSetController SubSetController{ 
        
        get{            
            if(SubSetController == null){
                size =20;                
                SubSetController = new ApexPages.StandardSetController([SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,Billing_Account_Number__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId order by Billing_Account_Number__c desc nulls Last]);
                system.debug('Return Records $$$$$$$$'+SubSetController);            
                this.SubSetController.setpageNumber(1);               
                this.SubSetController.setPageSize(size);
                noOfRecords = SubSetController.getResultSize(); 
            }
            return SubSetController;
          }set;
     }
     
     //Below logic is used for enable/disable of Target Account field based on Action field value
    public void getDisplayAccount( ){
       if(selectedActions!='Takeover'){
            AccountBool=false; 
        }
        else{
            AccountBool=true;
        }
    }
    
    //Following function implements wrapper logic 
    public List<wrapSubscription> getCurrentList( ){        
        updateSelectedSubscriptions();
        SubscriptionSetList = new List<wrapSubscription>();
        for (csord__Subscription__c vSubscription : (List<csord__Subscription__c >)SubSetController.getRecords( )){
            system.debug('vSubscription @@@@@@@@@ '+vSubscription);
            if(selectedSubscription.contains(vSubscription))
                SubscriptionSetList.add(new wrapSubscription(vSubscription,'true'));
            else
                SubscriptionSetList.add(new wrapSubscription(vSubscription));
                system.debug('SubscriptionSetList########'+SubscriptionSetList);
        }  
        fals=false;       
        return SubscriptionSetList;
    }
    
   //This method update the selected Subscriptions List in the wrapper Class
    public void updateSelectedSubscriptions( ){
        for(wrapSubscription cs: SubscriptionSetList){
            if(cs.selected){              
                selectedSubscription.add(cs.vSub);
                selectedSubscriptionList.addAll(selectedSubscription);
                system.debug('++++++++'+selectedSubscriptionList.size());
              }
            else{            
                if(selectedSubscription.contains(cs.vSub))
                selectedSubscription.remove(cs.vSub);                              
            }
            
        }
    }
    
    //This method adding the selected subscriptions to the list
    public void doSelectItem( ){        
        if(contextItem!=null)
            this.subids.add(this.contextItem);        
    }
    
    //This method remove the deselected subscriptions to the list
    public void doDeselectItem( ){      
        this.subids.remove(this.contextItem);        
    }
     
    //This method count the selected subscriptions
    public Integer getSelectedCount( ){       
       // subids.clear();
        for(csord__Subscription__c acc: selectedSubscription){
            subids.add(acc.id);
        }
        return this.subids.size();       
    }
     
    //Below method implements the Next button logic for pagination
    public void doNext( ){       
        if(this.SubSetController.getHasNext())
            this.SubSetController.next();       
    }
    
    
    //Below method for the Previous button logic for pagination
     public void doPrevious( ){       
        if(this.SubSetController.getHasPrevious())
            this.SubSetController.previous();        
    }
     
    public Boolean getHasPrevious( ){       
        return this.SubSetController.getHasPrevious();        
    }
       
       
    //Below method implements the Next button logic for pagination   
    public Boolean getHasNext( ){      
        return this.SubSetController.getHasNext();        
    }
       
       
    //Following method returns the current page number in pagination logic  
    public Integer getPageNumber( ){       
        return this.SubSetController.getPageNumber();        
    }
       
       
    //Following function implements the total pages number  
    public Integer getTotalPages( ){       
        Decimal totalSize = this.SubSetController.getResultSize();
        Decimal pageSize = this.SubSetController.getPageSize();       
        Decimal pages = totalSize/pageSize;       
        return (Integer)pages.round(System.RoundingMode.CEILING);
    } 
       
    //Below method has logic for Cancel button used in pagination       
    public PageReference cancel( ){
        return new PageReference('/'+accountid);
    }       
      
      
    //Following function will perform the validations behind the Continue button& restrict an user to proceed to next page if any of the validation fails.Also invokes the method provided by CS Team.
    public pageReference Proceed( ){
        SysDate = System.today();
        accountId=ApexPages.currentPage().getParameters().get('id');
        if(vSub.csord__Account__c!= null){
            vAccount=[Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:vSub.csord__Account__c];  
        }  
        
        vSourceAccount = [Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:accountId];
        if(selectedActions =='Takeover'){
            if(vSub.csord__Account__c==null){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please select The Target Account');
                ApexPages.addMessage(myMsg);            
                return null;          
            }                      
            if(vSub.csord__Account__c==accountId){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The target account is the same as the current account, it has to be different.');
                ApexPages.addMessage(myMsg);            
                return null; 
            } 
            
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c== null){                                                                     
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){                                                              
                system.debug('Negative Else1----');                                      
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            } 
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Positive' || vAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                        
                system.debug('========='+subids);
                if(subids.size()>0){
                try
                {
                    system.debug('@@@@@@@@@@ :'+selectedSubscriptionList.size());
                    system.debug('###########:'+vAccount.Id);
                    system.debug('***********:'+selectedActions);
                    system.debug('%%%%%%%%%%%:'+currentDateValue);
                    OpptyId = TB_PB_CloneOpportunity.createClonedOpportunity(selectedSubscriptionList,vAccount.Id,selectedActions,currentDateValue);
                    system.debug('Opportunity Id is :'+OpptyId);
                    PageReference pageOpportunity = new PageReference('/'+OpptyId);
                    system.debug('pageOpportunity is :'+pageOpportunity );
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                 }
                 catch(Exception e)
                 {
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'There was a technical problem encountered while carrying out this order. To retry click on Continue button again, if you still get this message please take a screen print and log a ticket in Remedy force');
                    ApexPages.addMessage(myMsg);                  
                 }
                  return null;  
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                    }   
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){                                                                          
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                system.debug('Negative----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == null || vAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                system.debug('Negative Else----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            }                                  
            return null;                              
        }                                                                                
        else if(selectedActions =='Move'){
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c== null){                            
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            }  
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Positive'|| vSourceAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                      
                system.debug('========='+subids);
                if(subids.size()>0){
                try
                {
                    system.debug('@@@@@@@@@@ :'+selectedSubscriptionList.size());
                    system.debug('###########:'+null);
                    system.debug('***********:'+selectedActions);
                    system.debug('%%%%%%%%%%%:'+currentDateValue);
                    OpptyId = TB_PB_CloneOpportunity.createClonedOpportunity(selectedSubscriptionList,null,selectedActions,currentDateValue);
                    system.debug('Opportunity Id is :'+OpptyId);
                    PageReference pageOpportunity = new PageReference('/'+OpptyId);
                    system.debug('pageOpportunity is :'+pageOpportunity );
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                 }
                 catch(Exception e)
                 {
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'There was a technical problem encountered while carrying out this order. To retry click on Continue button again, if you still get this message please take a screen print and log a ticket in Remedy force');
                    ApexPages.addMessage(myMsg);                  
                 }
                 return null;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }   
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == null || vSourceAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            } 
            return null; 
        }                                                                                                                                                                                                                                
            else{
                system.debug('========='+subids);
                if(subids.size()>0){
               try
                {
                    system.debug('@@@@@@@@@@ :'+selectedSubscriptionList.size());
                    system.debug('###########:'+null);
                    system.debug('***********:'+selectedActions);
                    system.debug('%%%%%%%%%%%:'+currentDateValue);
                    OpptyId = TB_PB_CloneOpportunity.createClonedOpportunity(selectedSubscriptionList,null,selectedActions,currentDateValue);
                    system.debug('Opportunity Id is :'+OpptyId);
                    PageReference pageOpportunity = new PageReference('/'+OpptyId);
                    system.debug('pageOpportunity is :'+pageOpportunity );
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                 }
                 catch(Exception e)
                 {
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'There was a technical problem encountered while carrying out this order. To retry click on Continue button again, if you still get this message please take a screen print and log a ticket in Remedy force');
                    ApexPages.addMessage(myMsg);                  
                 }
                 return null;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }        
                 
            } 
    }        
    
    //Wrapper class logic      
    public class wrapSubscription{
        public csord__Subscription__c vSub {get; set;}        
        public Boolean selected {get; set;}
        public wrapSubscription( ){
            vSub = new csord__Subscription__c();
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c a){
            vSub = a;
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c c,string s){
            vSub=c;
            selected=true;
        }       
        
    }
}





Following lines of code is not getting covered after so much permutations and combinations.
All these lines are called behind "Proceed" button.


This forum helped me earlier many times and this time again i am very hopeful and can expect that i would be able to make it beyond 75%.Many thanks in advance..

 
Hi All,
P.F.A my controller class and test class.I am unable to increase my code coverage after 50%.
public with sharing class AccountActionsWrapper{
       
    public List<wrapSubscription> SubscriptionSetList{get;set;}
    public integer size{get;set;}
    public String currentDateValue { get; set; }
    public String selectedActions{get;set;}
    public csord__Subscription__c vSub{get;set;}
    public List<csord__Subscription__c> vLstSub{get;set;}
    public Map<Id, List<csord__Subscription__c>> AccIdSubListMap { get; set; }
   
    public Map<Id, List<csord__Service__c>> SubIdServListMap { get; set; }
    Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    //public List<csord__Service__c> vLstServ{get;set;}
    public boolean AccountBool{get;set;}
    public boolean fals{get;set;}
    public Date SysDate{get;set;}
    public Account vAccount{get;set;}
    public Account vSourceAccount{get;set;}
    public String contextItem{get;set;}
    public integer noOfRecords{get;set;}
    public set<csord__Subscription__c > selectedSubscription;
    public set<id> subids;
    public string accountId;
    public String baseQuery;
    
    //Constructor for the class    
    public AccountActionsWrapper( ){
       
        AccIdSubListMap=new Map<Id, List<csord__Subscription__c>>();
        SubIdServListMap= new Map<Id, List<csord__Service__c>>();
        vSub= new csord__Subscription__c();
        selectedActions='Take Over';
        if(selectedActions=='Take Over'){
            AccountBool=true; 
        }
        fals= false; 
        this.subids = new set<id>();
        this.selectedSubscription = new set<csord__Subscription__c>();
        SubscriptionSetList = new List<wrapSubscription>();
        accountId=ApexPages.currentPage().getParameters().get('id');
        //baseQuery = 'SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId';
        //system.debug('Records &&&&&&'+baseQuery);
    }
        public List<selectOption> ActionValues {
        get {
          List<selectOption> options = new List<selectOption>();
    
          for (csordtelcoa__Change_Types__c cType : csordtelcoa__Change_Types__c.getAll().values())
            options.add(new SelectOption(cType.Name,cType.Name));
          return options;
        }
        set;
      }
    
    //This function implements the pagination logic
    public ApexPages.StandardSetController SubSetController{ 
        
        get{            
            if(SubSetController == null){
                size =20;
                //SubSetController = new ApexPages.StandardSetController(Database.getQueryLocator(baseQuery));
                SubSetController = new ApexPages.StandardSetController([SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,Billing_Account_Number__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId order by Billing_Account_Number__c desc nulls Last]);
                system.debug('Return Records $$$$$$$$'+SubSetController);            
                this.SubSetController.setpageNumber(1);               
                this.SubSetController.setPageSize(size);
                noOfRecords = SubSetController.getResultSize(); 
            }
            return SubSetController;
          }set;
     }
     
     //The following function is used for retrieving different picklist value from Action field
    public List<SelectOption> getActions( ){ 
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
     }
     
     
     //Below logic is used for enable/disable of Target Account field based on Action field value
    public void getDisplayAccount( ){
        if(selectedActions!='Take Over'){
            AccountBool=false; 
        }
        else{
            AccountBool=true;
        }
    }
    
    //Following function implements wrapper logic 
    public List<wrapSubscription> getCurrentList( ){        
        updateSelectedSubscriptions();
        SubscriptionSetList = new List<wrapSubscription>();
        for (csord__Subscription__c vSubscription : (List<csord__Subscription__c >)SubSetController.getRecords( )){
            system.debug('vSubscription @@@@@@@@@ '+vSubscription);
            if(selectedSubscription.contains(vSubscription))
                SubscriptionSetList.add(new wrapSubscription(vSubscription,'true'));
            else
                SubscriptionSetList.add(new wrapSubscription(vSubscription));
                system.debug('SubscriptionSetList########'+SubscriptionSetList);
        }  
        fals=false;       
        return SubscriptionSetList;
    }
    
   //This method update the selected Subscriptions List in the wrapper Class
    public void updateSelectedSubscriptions( ){
        for(wrapSubscription cs: SubscriptionSetList){
            if(cs.selected)
                selectedSubscription.add(cs.vSub);
            else
            {
                if(selectedSubscription.contains(cs.vSub))
                selectedSubscription.remove(cs.vSub);
                
            }
            
        }
    }
    
    //This method adding the selected subscriptions to the list
    public void doSelectItem( ){        
        if(contextItem!=null)
            this.subids.add(this.contextItem);        
    }
    
    //This method remove the deselected subscriptions to the list
    public void doDeselectItem( ){      
        this.subids.remove(this.contextItem);        
    }
     
    //This method count the selected subscriptions
    public Integer getSelectedCount( ){       
        subids.clear();
        for(csord__Subscription__c acc: selectedSubscription){
            subids.add(acc.id);
        }
        return this.subids.size();       
    }
     
    //Below method implements the Next button logic for pagination
    public void doNext( ){       
        if(this.SubSetController.getHasNext())
            this.SubSetController.next();       
    }
    
    
    //Below method for the Previous button logic for pagination
     public void doPrevious( ){       
        if(this.SubSetController.getHasPrevious())
            this.SubSetController.previous();        
    }
     
    public Boolean getHasPrevious( ){       
        return this.SubSetController.getHasPrevious();        
    }
       
       
    //Below method implements the Next button logic for pagination   
    public Boolean getHasNext( ){      
        return this.SubSetController.getHasNext();        
    }
       
       
    //Following method returns the current page number in pagination logic  
    public Integer getPageNumber( ){       
        return this.SubSetController.getPageNumber();        
    }
       
       
    //Following function implements the total pages number  
    public Integer getTotalPages( ){       
        Decimal totalSize = this.SubSetController.getResultSize();
        Decimal pageSize = this.SubSetController.getPageSize();       
        Decimal pages = totalSize/pageSize;       
        return (Integer)pages.round(System.RoundingMode.CEILING);
    } 
       
    //Below method has logic for Cancel button used in pagination       
    public PageReference cancel( ){
        return new PageReference('/'+accountid);
    }       
      
      
    //Following function will perform the validations behind the Continue button& restrict an user to proceed to next page if any of the validation fails.Also invokes the method provided by CS Team.
    public pageReference Proceed( ){
        SysDate = System.today();
        accountId=ApexPages.currentPage().getParameters().get('id');
        if(vSub.csord__Account__c!= null){
            vAccount=[Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:vSub.csord__Account__c];  
        }   
             //Venkat added the below logic
        vSourceAccount = [Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:accountId];
        if(selectedActions =='Take Over'){
            if(vSub.csord__Account__c==null){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please select The Target Account');
                ApexPages.addMessage(myMsg);            
                return null;          
            }  
                   
                    
            if(vSub.csord__Account__c==accountId){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The target account is the same as the current account, it has to be different.');
                ApexPages.addMessage(myMsg);            
                return null; 
            }
                       
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c== null){                                                                     
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
                                  
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){                                                              
                system.debug('Negative Else1----');                                      
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            } 
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Positive' || vAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                        
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                    }   
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){                                                                          
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                system.debug('Negative----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == null || vAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                system.debug('Negative Else----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            }                                  
            return null;                              
        }                                                                                
        else if(selectedActions =='Move'){
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c== null){                            
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            }  
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Positive'|| vSourceAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                      
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }   
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == null || vSourceAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            } 
            return null; 
        }                                                                                                                                                                                                                                
            else{
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }        
                 
            } 
    }        
    
    //Wrapper class logic      
    public class wrapSubscription{
        public csord__Subscription__c vSub {get; set;}        
        public Boolean selected {get; set;}
        //public List<csord__Service__c> vServ{get;set;}
        //public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription( ){
            vSub = new csord__Subscription__c();
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c a){
            vSub = a;
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c c,string s){
            vSub=c;
            selected=true;
        }       
        
    }
}
@isTest(seeAlldata=true)
public class TfB_PB_TestAccountActionsWrapper
{
    
    public static testMethod void myUnitTest() 
    { 
         
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6548681',TfB_PB_CreditCheckResponse__c='Positive',TfB_PB_CreditCheckExpiryDate__c=system.today()+1);
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
        /*List<selectOption> options = new  List<selectOption>();
        options.add('Takeover');
        options.add('Move');*/
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
        objActWap.getDisplayAccount();
        //objActWap.ActionValues=;
        objActWap.getCurrentList();
        objActWap.updateSelectedSubscriptions();
        objActWap.doSelectItem();
        objActWap.doDeselectItem();
        objActWap.getSelectedCount();
        objActWap.doNext();
        objActWap.doPrevious();
        objActWap.getHasPrevious();
        objActWap.getHasNext();
        objActWap.cancel();
        objActWap.getTotalPages();
        objActWap.getPageNumber();
        
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest1() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6590681',TfB_PB_CreditCheckResponse__c='Negative-1',TfB_PB_CreditCheckExpiryDate__c=system.today()-1);
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest2() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='738745936',TfB_PB_CreditCheckResponse__c='Negative-1');
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Takeover';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest3() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6548681',TfB_PB_CreditCheckResponse__c='Positive');
        insert SourceAcc; 
        
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
        /*List<selectOption> options = new  List<selectOption>();
        options.add('Takeover');
        options.add('Move');*/
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Takeover';
        objActWap.Proceed();
        objActWap.getDisplayAccount();
        //objActWap.ActionValues=;
        objActWap.getCurrentList();
        objActWap.updateSelectedSubscriptions();
        objActWap.doSelectItem();
        objActWap.doDeselectItem();
        objActWap.getSelectedCount();
        objActWap.doNext();
        objActWap.doPrevious();
        objActWap.getHasPrevious();
        objActWap.getHasNext();
        objActWap.cancel();
        objActWap.getTotalPages();
        objActWap.getPageNumber();
        
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
  

    
    
}
especially it is "Proceed" Method in controller class which is not covering.Lines in Proceed method is not covering.

Please help me out to achieve sufficient code coverage.
Many thanks in advance.

 
Hi All,
P.F.A my controller class and test class.I am unable to increase my code coverage after 50%.
public with sharing class AccountActionsWrapper{
       
    public List<wrapSubscription> SubscriptionSetList{get;set;}
    public integer size{get;set;}
    public String currentDateValue { get; set; }
    public String selectedActions{get;set;}
    public csord__Subscription__c vSub{get;set;}
    public List<csord__Subscription__c> vLstSub{get;set;}
    public Map<Id, List<csord__Subscription__c>> AccIdSubListMap { get; set; }
   
    public Map<Id, List<csord__Service__c>> SubIdServListMap { get; set; }
    Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    //public List<csord__Service__c> vLstServ{get;set;}
    public boolean AccountBool{get;set;}
    public boolean fals{get;set;}
    public Date SysDate{get;set;}
    public Account vAccount{get;set;}
    public Account vSourceAccount{get;set;}
    public String contextItem{get;set;}
    public integer noOfRecords{get;set;}
    public set<csord__Subscription__c > selectedSubscription;
    public set<id> subids;
    public string accountId;
    public String baseQuery;
    
    //Constructor for the class    
    public AccountActionsWrapper( ){
       
        AccIdSubListMap=new Map<Id, List<csord__Subscription__c>>();
        SubIdServListMap= new Map<Id, List<csord__Service__c>>();
        vSub= new csord__Subscription__c();
        selectedActions='Take Over';
        if(selectedActions=='Take Over'){
            AccountBool=true; 
        }
        fals= false; 
        this.subids = new set<id>();
        this.selectedSubscription = new set<csord__Subscription__c>();
        SubscriptionSetList = new List<wrapSubscription>();
        accountId=ApexPages.currentPage().getParameters().get('id');
        //baseQuery = 'SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId';
        //system.debug('Records &&&&&&'+baseQuery);
    }
        public List<selectOption> ActionValues {
        get {
          List<selectOption> options = new List<selectOption>();
    
          for (csordtelcoa__Change_Types__c cType : csordtelcoa__Change_Types__c.getAll().values())
            options.add(new SelectOption(cType.Name,cType.Name));
          return options;
        }
        set;
      }
    
    //This function implements the pagination logic
    public ApexPages.StandardSetController SubSetController{ 
        
        get{            
            if(SubSetController == null){
                size =20;
                //SubSetController = new ApexPages.StandardSetController(Database.getQueryLocator(baseQuery));
                SubSetController = new ApexPages.StandardSetController([SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,Billing_Account_Number__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId order by Billing_Account_Number__c desc nulls Last]);
                system.debug('Return Records $$$$$$$$'+SubSetController);            
                this.SubSetController.setpageNumber(1);               
                this.SubSetController.setPageSize(size);
                noOfRecords = SubSetController.getResultSize(); 
            }
            return SubSetController;
          }set;
     }
     
     //The following function is used for retrieving different picklist value from Action field
    public List<SelectOption> getActions( ){ 
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
     }
     
     
     //Below logic is used for enable/disable of Target Account field based on Action field value
    public void getDisplayAccount( ){
        if(selectedActions!='Take Over'){
            AccountBool=false; 
        }
        else{
            AccountBool=true;
        }
    }
    
    //Following function implements wrapper logic 
    public List<wrapSubscription> getCurrentList( ){        
        updateSelectedSubscriptions();
        SubscriptionSetList = new List<wrapSubscription>();
        for (csord__Subscription__c vSubscription : (List<csord__Subscription__c >)SubSetController.getRecords( )){
            system.debug('vSubscription @@@@@@@@@ '+vSubscription);
            if(selectedSubscription.contains(vSubscription))
                SubscriptionSetList.add(new wrapSubscription(vSubscription,'true'));
            else
                SubscriptionSetList.add(new wrapSubscription(vSubscription));
                system.debug('SubscriptionSetList########'+SubscriptionSetList);
        }  
        fals=false;       
        return SubscriptionSetList;
    }
    
   //This method update the selected Subscriptions List in the wrapper Class
    public void updateSelectedSubscriptions( ){
        for(wrapSubscription cs: SubscriptionSetList){
            if(cs.selected)
                selectedSubscription.add(cs.vSub);
            else
            {
                if(selectedSubscription.contains(cs.vSub))
                selectedSubscription.remove(cs.vSub);
                
            }
            
        }
    }
    
    //This method adding the selected subscriptions to the list
    public void doSelectItem( ){        
        if(contextItem!=null)
            this.subids.add(this.contextItem);        
    }
    
    //This method remove the deselected subscriptions to the list
    public void doDeselectItem( ){      
        this.subids.remove(this.contextItem);        
    }
     
    //This method count the selected subscriptions
    public Integer getSelectedCount( ){       
        subids.clear();
        for(csord__Subscription__c acc: selectedSubscription){
            subids.add(acc.id);
        }
        return this.subids.size();       
    }
     
    //Below method implements the Next button logic for pagination
    public void doNext( ){       
        if(this.SubSetController.getHasNext())
            this.SubSetController.next();       
    }
    
    
    //Below method for the Previous button logic for pagination
     public void doPrevious( ){       
        if(this.SubSetController.getHasPrevious())
            this.SubSetController.previous();        
    }
     
    public Boolean getHasPrevious( ){       
        return this.SubSetController.getHasPrevious();        
    }
       
       
    //Below method implements the Next button logic for pagination   
    public Boolean getHasNext( ){      
        return this.SubSetController.getHasNext();        
    }
       
       
    //Following method returns the current page number in pagination logic  
    public Integer getPageNumber( ){       
        return this.SubSetController.getPageNumber();        
    }
       
       
    //Following function implements the total pages number  
    public Integer getTotalPages( ){       
        Decimal totalSize = this.SubSetController.getResultSize();
        Decimal pageSize = this.SubSetController.getPageSize();       
        Decimal pages = totalSize/pageSize;       
        return (Integer)pages.round(System.RoundingMode.CEILING);
    } 
       
    //Below method has logic for Cancel button used in pagination       
    public PageReference cancel( ){
        return new PageReference('/'+accountid);
    }       
      
      
    //Following function will perform the validations behind the Continue button& restrict an user to proceed to next page if any of the validation fails.Also invokes the method provided by CS Team.
    public pageReference Proceed( ){
        SysDate = System.today();
        accountId=ApexPages.currentPage().getParameters().get('id');
        if(vSub.csord__Account__c!= null){
            vAccount=[Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:vSub.csord__Account__c];  
        }   
             //Venkat added the below logic
        vSourceAccount = [Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:accountId];
        if(selectedActions =='Take Over'){
            if(vSub.csord__Account__c==null){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please select The Target Account');
                ApexPages.addMessage(myMsg);            
                return null;          
            }  
                   
                    
            if(vSub.csord__Account__c==accountId){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The target account is the same as the current account, it has to be different.');
                ApexPages.addMessage(myMsg);            
                return null; 
            }
                       
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c== null){                                                                     
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
                                  
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){                                                              
                system.debug('Negative Else1----');                                      
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            } 
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Positive' || vAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                        
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                    }   
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){                                                                          
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                system.debug('Negative----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == null || vAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                system.debug('Negative Else----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            }                                  
            return null;                              
        }                                                                                
        else if(selectedActions =='Move'){
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c== null){                            
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            }  
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Positive'|| vSourceAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                      
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }   
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == null || vSourceAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            } 
            return null; 
        }                                                                                                                                                                                                                                
            else{
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }        
                 
            } 
    }        
    
    //Wrapper class logic      
    public class wrapSubscription{
        public csord__Subscription__c vSub {get; set;}        
        public Boolean selected {get; set;}
        //public List<csord__Service__c> vServ{get;set;}
        //public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription( ){
            vSub = new csord__Subscription__c();
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c a){
            vSub = a;
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c c,string s){
            vSub=c;
            selected=true;
        }       
        
    }
}
@isTest(seeAlldata=true)
public class TfB_PB_TestAccountActionsWrapper
{
    
    public static testMethod void myUnitTest() 
    { 
         
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6548681',TfB_PB_CreditCheckResponse__c='Positive',TfB_PB_CreditCheckExpiryDate__c=system.today()+1);
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
        /*List<selectOption> options = new  List<selectOption>();
        options.add('Takeover');
        options.add('Move');*/
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
        objActWap.getDisplayAccount();
        //objActWap.ActionValues=;
        objActWap.getCurrentList();
        objActWap.updateSelectedSubscriptions();
        objActWap.doSelectItem();
        objActWap.doDeselectItem();
        objActWap.getSelectedCount();
        objActWap.doNext();
        objActWap.doPrevious();
        objActWap.getHasPrevious();
        objActWap.getHasNext();
        objActWap.cancel();
        objActWap.getTotalPages();
        objActWap.getPageNumber();
        
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest1() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6590681',TfB_PB_CreditCheckResponse__c='Negative-1',TfB_PB_CreditCheckExpiryDate__c=system.today()-1);
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest2() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='738745936',TfB_PB_CreditCheckResponse__c='Negative-1');
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Takeover';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest3() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6548681',TfB_PB_CreditCheckResponse__c='Positive');
        insert SourceAcc; 
        
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
        /*List<selectOption> options = new  List<selectOption>();
        options.add('Takeover');
        options.add('Move');*/
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Takeover';
        objActWap.Proceed();
        objActWap.getDisplayAccount();
        //objActWap.ActionValues=;
        objActWap.getCurrentList();
        objActWap.updateSelectedSubscriptions();
        objActWap.doSelectItem();
        objActWap.doDeselectItem();
        objActWap.getSelectedCount();
        objActWap.doNext();
        objActWap.doPrevious();
        objActWap.getHasPrevious();
        objActWap.getHasNext();
        objActWap.cancel();
        objActWap.getTotalPages();
        objActWap.getPageNumber();
        
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
  

    
    
}

especially it is "Proceed" Method in controller class which is not covering.

Please help me out to achieve sufficient code coverage.
Many thanks in advance.
 
Hi all i wrote a class and now i am working on test class for the same.
I am not able to increase the code coverage beyond 60%.
I am attaching my test class written so far and the piece of code from main class which is not getting covered.
@isTest(seeAlldata=true)
public class TfB_PB_TestAccountActionsWrapper
{
    public static testMethod void myUnitTest() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6548681',TfB_PB_CreditCheckResponse__c='Positive',TfB_PB_CreditCheckExpiryDate__c=system.today()+1);
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
        /*List<selectOption> options = new  List<selectOption>();
        options.add('Takeover');
        options.add('Move');*/
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
        objActWap.getDisplayAccount();
        //objActWap.ActionValues=;
        objActWap.getCurrentList();
        objActWap.updateSelectedSubscriptions();
        objActWap.doSelectItem();
        objActWap.doDeselectItem();
        objActWap.getSelectedCount();
        objActWap.doNext();
        objActWap.doPrevious();
        objActWap.getHasPrevious();
        objActWap.getHasNext();
        objActWap.cancel();
        objActWap.getTotalPages();
        objActWap.getPageNumber();
        
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest1() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6590681',TfB_PB_CreditCheckResponse__c='Negative-1',TfB_PB_CreditCheckExpiryDate__c=system.today()-1);
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest2() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='738745936',TfB_PB_CreditCheckResponse__c='Negative-1');
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'Test1');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Takeover';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest3() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6548681',TfB_PB_CreditCheckResponse__c='Positive');
        insert SourceAcc; 
        
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'test');
        insert objCS;
        /*List<selectOption> options = new  List<selectOption>();
        options.add('Takeover');
        options.add('Move');*/
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Takeover';
        objActWap.Proceed();
        objActWap.getDisplayAccount();
        //objActWap.ActionValues=;
        objActWap.getCurrentList();
        objActWap.updateSelectedSubscriptions();
        objActWap.doSelectItem();
        objActWap.doDeselectItem();
        objActWap.getSelectedCount();
        objActWap.doNext();
        objActWap.doPrevious();
        objActWap.getHasPrevious();
        objActWap.getHasNext();
        objActWap.cancel();
        objActWap.getTotalPages();
        objActWap.getPageNumber();
        
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    
    
}

and below is the method from my controller whhich is not getting covered after giving it so much try.
public pageReference Proceed( ){
        SysDate = System.today();
        accountId=ApexPages.currentPage().getParameters().get('id');
        if(vSub.csord__Account__c!= null){
            vAccount=[Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:vSub.csord__Account__c];  
        }   
             //Venkat added the below logic
        vSourceAccount = [Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:accountId];
        if(selectedActions =='Takeover'){
            if(vSub.csord__Account__c==null){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please select The Target Account');
                ApexPages.addMessage(myMsg);            
                return null;          
            }  
                   
                    
            if(vSub.csord__Account__c==accountId){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The target account is the same as the current account, it has to be different.');
                ApexPages.addMessage(myMsg);            
                return null; 
            }
                       
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c== null){                                                                     
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
                                  
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){                                                              
                system.debug('Negative Else1----');                                      
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            } 
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Positive' || vAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                        
                if(subids.size()>0){
                    oppList = [select id, Name, AccountId from Opportunity where AccountId=:accountId limit 1];                 
                    PageReference pageOpportunity = new PageReference('/'+oppList.Id);
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                    }   
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){                                                                          
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                system.debug('Negative----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == null || vAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                system.debug('Negative Else----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            }                                  
            return null;                              
        }                                                                                
        else if(selectedActions =='Move'){
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c== null){                            
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            }  
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Positive'|| vSourceAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                      
                if(subids.size()>0){
                    oppList = [select id, Name, AccountId from Opportunity where AccountId=:accountId limit 1];                 
                    PageReference pageOpportunity = new PageReference('/'+oppList.Id);
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }   
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == null || vSourceAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            } 
            return null; 
        }                                                                                                                                                                                                                                
            else{
                if(subids.size()>0){
                    oppList = [select id, Name, AccountId from Opportunity where AccountId=:accountId limit 1];                 
                    PageReference pageOpportunity = new PageReference('/'+oppList.Id);
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }        
                 
            } 
    }

My current code coverage is 50% only and i am not able to increase it further after giving it so much try.Please help me out here to achieve sufficient code coverage.
Many thanks in advance.
Hi All,
P.F.A my controller class and test class.I am unable to increase my code coverage after 60%.
public with sharing class AccountActionsWrapper{
       
    public List<wrapSubscription> SubscriptionSetList{get;set;}
    public integer size{get;set;}
    public String currentDateValue { get; set; }
    public String selectedActions{get;set;}
    public csord__Subscription__c vSub{get;set;}
    public List<csord__Subscription__c> vLstSub{get;set;}
    public Map<Id, List<csord__Subscription__c>> AccIdSubListMap { get; set; }
   
    public Map<Id, List<csord__Service__c>> SubIdServListMap { get; set; }
    Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    //public List<csord__Service__c> vLstServ{get;set;}
    public boolean AccountBool{get;set;}
    public boolean fals{get;set;}
    public Date SysDate{get;set;}
    public Account vAccount{get;set;}
    public Account vSourceAccount{get;set;}
    public String contextItem{get;set;}
    public integer noOfRecords{get;set;}
    public set<csord__Subscription__c > selectedSubscription;
    public set<id> subids;
    public string accountId;
    public String baseQuery;
    
    //Constructor for the class    
    public AccountActionsWrapper( ){
       
        AccIdSubListMap=new Map<Id, List<csord__Subscription__c>>();
        SubIdServListMap= new Map<Id, List<csord__Service__c>>();
        vSub= new csord__Subscription__c();
        selectedActions='Take Over';
        if(selectedActions=='Take Over'){
            AccountBool=true; 
        }
        fals= false; 
        this.subids = new set<id>();
        this.selectedSubscription = new set<csord__Subscription__c>();
        SubscriptionSetList = new List<wrapSubscription>();
        accountId=ApexPages.currentPage().getParameters().get('id');
        //baseQuery = 'SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId';
        //system.debug('Records &&&&&&'+baseQuery);
    }
        public List<selectOption> ActionValues {
        get {
          List<selectOption> options = new List<selectOption>();
    
          for (csordtelcoa__Change_Types__c cType : csordtelcoa__Change_Types__c.getAll().values())
            options.add(new SelectOption(cType.Name,cType.Name));
          return options;
        }
        set;
      }
    
    //This function implements the pagination logic
    public ApexPages.StandardSetController SubSetController{ 
        
        get{            
            if(SubSetController == null){
                size =20;
                //SubSetController = new ApexPages.StandardSetController(Database.getQueryLocator(baseQuery));
                SubSetController = new ApexPages.StandardSetController([SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,Billing_Account_Number__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId order by Billing_Account_Number__c desc nulls Last]);
                system.debug('Return Records $$$$$$$$'+SubSetController);            
                this.SubSetController.setpageNumber(1);               
                this.SubSetController.setPageSize(size);
                noOfRecords = SubSetController.getResultSize(); 
            }
            return SubSetController;
          }set;
     }
     
     //The following function is used for retrieving different picklist value from Action field
    public List<SelectOption> getActions( ){ 
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
     }
     
     
     //Below logic is used for enable/disable of Target Account field based on Action field value
    public void getDisplayAccount( ){
        if(selectedActions!='Take Over'){
            AccountBool=false; 
        }
        else{
            AccountBool=true;
        }
    }
    
    //Following function implements wrapper logic 
    public List<wrapSubscription> getCurrentList( ){        
        updateSelectedSubscriptions();
        SubscriptionSetList = new List<wrapSubscription>();
        for (csord__Subscription__c vSubscription : (List<csord__Subscription__c >)SubSetController.getRecords( )){
            system.debug('vSubscription @@@@@@@@@ '+vSubscription);
            if(selectedSubscription.contains(vSubscription))
                SubscriptionSetList.add(new wrapSubscription(vSubscription,'true'));
            else
                SubscriptionSetList.add(new wrapSubscription(vSubscription));
                system.debug('SubscriptionSetList########'+SubscriptionSetList);
        }  
        fals=false;       
        return SubscriptionSetList;
    }
    
   //This method update the selected Subscriptions List in the wrapper Class
    public void updateSelectedSubscriptions( ){
        for(wrapSubscription cs: SubscriptionSetList){
            if(cs.selected)
                selectedSubscription.add(cs.vSub);
            else
            {
                if(selectedSubscription.contains(cs.vSub))
                selectedSubscription.remove(cs.vSub);
                
            }
            
        }
    }
    
    //This method adding the selected subscriptions to the list
    public void doSelectItem( ){        
        if(contextItem!=null)
            this.subids.add(this.contextItem);        
    }
    
    //This method remove the deselected subscriptions to the list
    public void doDeselectItem( ){      
        this.subids.remove(this.contextItem);        
    }
     
    //This method count the selected subscriptions
    public Integer getSelectedCount( ){       
        subids.clear();
        for(csord__Subscription__c acc: selectedSubscription){
            subids.add(acc.id);
        }
        return this.subids.size();       
    }
     
    //Below method implements the Next button logic for pagination
    public void doNext( ){       
        if(this.SubSetController.getHasNext())
            this.SubSetController.next();       
    }
    
    
    //Below method for the Previous button logic for pagination
     public void doPrevious( ){       
        if(this.SubSetController.getHasPrevious())
            this.SubSetController.previous();        
    }
     
    public Boolean getHasPrevious( ){       
        return this.SubSetController.getHasPrevious();        
    }
       
       
    //Below method implements the Next button logic for pagination   
    public Boolean getHasNext( ){      
        return this.SubSetController.getHasNext();        
    }
       
       
    //Following method returns the current page number in pagination logic  
    public Integer getPageNumber( ){       
        return this.SubSetController.getPageNumber();        
    }
       
       
    //Following function implements the total pages number  
    public Integer getTotalPages( ){       
        Decimal totalSize = this.SubSetController.getResultSize();
        Decimal pageSize = this.SubSetController.getPageSize();       
        Decimal pages = totalSize/pageSize;       
        return (Integer)pages.round(System.RoundingMode.CEILING);
    } 
       
    //Below method has logic for Cancel button used in pagination       
    public PageReference cancel( ){
        return new PageReference('/'+accountid);
    }       
      
      
    //Following function will perform the validations behind the Continue button& restrict an user to proceed to next page if any of the validation fails.Also invokes the method provided by CS Team.
    public pageReference Proceed( ){
        SysDate = System.today();
        accountId=ApexPages.currentPage().getParameters().get('id');
        if(vSub.csord__Account__c!= null){
            vAccount=[Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:vSub.csord__Account__c];  
        }   
             //Venkat added the below logic
        vSourceAccount = [Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:accountId];
        if(selectedActions =='Take Over'){
            if(vSub.csord__Account__c==null){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please select The Target Account');
                ApexPages.addMessage(myMsg);            
                return null;          
            }  
                   
                    
            if(vSub.csord__Account__c==accountId){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The target account is the same as the current account, it has to be different.');
                ApexPages.addMessage(myMsg);            
                return null; 
            }
                       
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c== null){                                                                     
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
                                  
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){                                                              
                system.debug('Negative Else1----');                                      
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            } 
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Positive' || vAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                        
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                    }   
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){                                                                          
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                system.debug('Negative----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == null || vAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                system.debug('Negative Else----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            }                                  
            return null;                              
        }                                                                                
        else if(selectedActions =='Move'){
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c== null){                            
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            }  
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Positive'|| vSourceAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                      
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }   
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == null || vSourceAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            } 
            return null; 
        }                                                                                                                                                                                                                                
            else{
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }        
                 
            } 
    }        
    
    //Wrapper class logic      
    public class wrapSubscription{
        public csord__Subscription__c vSub {get; set;}        
        public Boolean selected {get; set;}
        //public List<csord__Service__c> vServ{get;set;}
        //public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription( ){
            vSub = new csord__Subscription__c();
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c a){
            vSub = a;
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c c,string s){
            vSub=c;
            selected=true;
        }       
        
    }
}
@isTest(seeAlldata=true)
public class TfB_PB_TestAccountActionsWrapper
{
    public static testMethod void myUnitTest() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6548681',TfB_PB_CreditCheckResponse__c='Positive');
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'test');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
        objActWap.getActions();
        objActWap.getDisplayAccount();
        objActWap.getCurrentList();
        objActWap.updateSelectedSubscriptions();
        objActWap.doSelectItem();
        objActWap.doDeselectItem();
        objActWap.getSelectedCount();
        objActWap.doNext();
        objActWap.doPrevious();
        objActWap.getHasPrevious();
        objActWap.getHasNext();
        objActWap.cancel();
        objActWap.getTotalPages();
        objActWap.getPageNumber();
        
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest1() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6590681',TfB_PB_CreditCheckExpiryDate__c=system.today()-1);
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'test');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest2() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test2',C_fe_Customer_Number__c='738745936',TfB_PB_CreditCheckResponse__c='Negative-1');
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'test');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    
    
}
Whenver i am covering one if case lets say Suppose i am covering if condition for "Positive" for Take Over scenario(refer above code),then Negative-1 or Negative-2 code become uncovered and vice cersa.I am not able to increase after 605 after so many try.
Ply help me on this.

Mnay thanks in advance.

 
Hi All,
I have a requiremnt which i am describing below:
There is a button called "Continue" on UI. When an user clicks on it it will redirect to some other page. But prior to that one validations need to be done. As you people can see in the screen shot which i attached here is there is checkbox along with the name of each subscription. So my requirement is if an user does not select any single subscription with "Active" status and if user clicks on proceed button an error message must be thrown "Please select al least one active subscription".
I am attaching the corresponding code and Visual force page with the screen shot.
public with sharing class AccountActionsWrapper
{       
    public String contextItem{get;set;}   
    public set<Id> selectedContactIds{get;set;}
    public String accountName {get; set;}
    public string accountid;
    public String selectedActions{get;set;}
    public boolean AccountBool{get;set;}
    public List<Account> accounts {get; set;}
    public List<csord__Service__c> vLstServ{ get; set; }
    public Id acctId {get; set;}
    public integer size{get;set;}
    public Map<Id, List<csord__Service__c>> memIdServListMap { get; set; }
    public integer noOfRecords{get;set;}
    public Date dat {get;set;}
    Set<Id> SubIds = new Set<Id>();
    public boolean Display{get;set;}
     Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public List<csord__Subscription__c>vLstSubscriptions{get;set;}
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;} 
    public Boolean isCancel{get;set;}
    public String query {get; set;}
    public String dateError {get;set;}
    public String currentDateValue { get; set; }

    public ApexPages.StandardSetController setCon {
        get{
            if(setCon == null){
           size =20; 
           accountid=ApexPages.currentPage().getParameters().get('id');
           selectedContactIds= new Set<Id>();       
           setCon= new ApexPages.StandardSetController( [select Id, Name,csord__Status__c,MACD_in_progress__c , csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid] );
           this.setCon.setpageNumber(1);
           setCon.setPageSize(size);
           noOfRecords = setCon.getResultSize();            
            }
            return setCon;
        }set;
    }
    
     public AccountActionsWrapper() 
     {
       selectedActions='Take Over';
       if(selectedActions=='Take Over')
       {
          AccountBool=true; 
       } 
      }
        
    public List<SelectOption> getActions() {
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
    }
    public void getDisplayAccount()
    {
        if(selectedActions!='Take Over')
        {
           AccountBool=false; 
        }
        else
        {
             AccountBool=true;
        }
    }
    
    //function to get date value    
     public void getValue(){
      System.debug('*************'+currentDateValue);
      
    
     }
     
     //Function to retrieving account detail in pop-up upon clicking on Lookup in VF page
     public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }   
    
    public void doSelectItem()
    {
      this.selectedContactIds.add(this.contextItem);
    } 
    public void doDeselectItem()
    {
      this.selectedContactIds.remove(this.contextItem);
    } 
    public Integer getSelectedCount()
    {
      return this.selectedContactIds.size();
    }
    public void doNext()
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
    } 
    public void doPrevious()
    {
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doStart() 
    { 
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doEnd() 
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
   }
     
    public List<wrapSubscription> getSubscriptions()
    { 
        
        List<wrapSubscription> rows = new List<wrapSubscription>(); 
        //vLstSubscriptions = [select Id, Name,csord__Status__c, csord__Account__c,(select Id,Billing_Account_Number__c from csord__Services__r) from csord__Subscription__c where csord__Account__c=:accountid limit 100];
        for(sObject r : this.setCon.getRecords())
        {
            csord__Subscription__c c = (csord__Subscription__c)r;
            wrapSubscription row = new wrapSubscription(c,vLstServ);
            if(this.selectedContactIds.contains(c.Id))
            {
                row.selected=true;
            }
            else
            {
                row.selected=false;
            }
            rows.add(row);
        }
        return rows;
         
    }
    public PageReference cancel()
    {
        return new PageReference('/'+accountid);
    }
    public Boolean getHasPrevious()
    { 
        return this.setCon.getHasPrevious();
    } 
    public Boolean getHasNext()
    {
       return this.setCon.getHasNext(); 
    }  
    public Integer getPageNumber()
    {
       return this.setCon.getPageNumber();
    } 
    Public Integer getTotalPages()
    {
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
        Decimal pages = totalSize/pageSize; 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }  
    public class wrapSubscription
    { 
        public csord__Subscription__c sub {get; set;}        
        public Boolean selected {get; set;}
        public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription(csord__Subscription__c c,List<csord__Service__c> vLstServ)
        {
            this.sub=c;
            this.Serv=vLstServ;
            this.selected=false;
        }
 
    }
}
 
<apex:page docType="html-5.0" controller="AccountActionsWrapper" sidebar="false" showHeader="false" id="pg" >

<head>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
</head>


<!--for mm/dd/yyyy format-->
<!--<script>
       $(function(){
        $('.datepicker').datepicker({
             minDate: 0 
         }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>-->

<!--for dd/mm/yyyy format-->
<script>
       $(function(){
        $('.datepicker').datepicker({ minDate: 0 , dateFormat: 'dd/mm/yy' }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>


<script>
    var newWin=null;
    function openLookupPopup(name, id)
    {
        var url="/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
        newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
    }
                  
    function closeLookupPopup()
    {
       if (null!=newWin)
       {
          newWin.close();
       }  
    }
    
  
    
     function doCheckboxChange(cb,itemId){ 
            if(cb.checked==true){
                aSelectItem(itemId);
            }
            else{
                aDeselectItem(itemId);
            }
        }
</script>

    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
   
    <apex:form >
    <apex:pageBlock >    
      <apex:pageBlockSection >    
        <apex:pageBlockSectionItem >
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1" >
                <apex:selectOptions value="{!Actions}"/>
                <apex:actionSupport event="onchange" action="{!getDisplayAccount}" reRender="panel"/>             
            </apex:selectList>
           </apex:pageBlockSectionItem>
           </apex:pageBlockSection>
      <apex:outputPanel >        
       <apex:pageBlockSection >     
           <apex:pageBlockSectionItem >          
           <apex:outputLabel value="Target Account"/>        
           <apex:outputPanel id="panel" >
            <apex:inputHidden value="{!acctId}" id="targetId"/>
            <apex:inputText size="40" value="{!accountName}" id="targetName" onFocus="this.blur()" disabled="{!!AccountBool}"/>&nbsp;
            
            <apex:outputLink rendered="{!AccountBool}" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</apex:outputLink>                    
          </apex:outputPanel>          
      </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      </apex:outputPanel>
               <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                <!--Date: <apex:input type="date" value="{!dat}" required="false"/>--> 
                Effective From:<apex:inputText id="datepicker" styleClass="datepicker"  value="{!currentDateValue}" required="false"/>              
            </apex:pageBlockSectionItem>           
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>       
    </apex:pageBlock>   
        
        <!-- handle selected item -->
        <apex:actionFunction name="aSelectItem" action="{!doSelectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <!-- handle deselected item -->
        <apex:actionFunction name="aDeselectItem" action="{!doDeselectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>        
         <apex:pageBlock title="Select Subscriptions" id="mpb">        
            <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
            <apex:pageBlockTable value="{!Subscriptions}" var="c">
                <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>                       
                            <apex:inputCheckbox value="{!c.selected}" id="inputId" disabled="{!NOT(c.sub.csord__Status__c=='Active') && (c.sub.MACD_in_progress__c=False)}" onchange="doCheckboxChange(this,'{!c.sub.Id}')"/>
                            
                    </apex:column>           
                 <apex:column headerValue="Subscription Name" >                       
                       <apex:outputLink value="/{!c.sub.Id}" target="_blank"> {!c.sub.Name} </apex:outputLink>
                   </apex:column>
                <apex:column value="{!c.sub.csord__Status__c}"/>                
                           
            </apex:pageBlockTable>
            </apex:pageblockSection>
           
        <apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}" title="First Page"/>
        <apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
        <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
        <apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next Page"/>
        <apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last Page"/>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Continue "  />
                <apex:commandButton value="Back" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
        </apex:pageBlock>        
    </apex:form>
</apex:page>

screen shot
This forum has helped me out earlier also and i am very hopeful that you people will help me out this time also.
Please fine tune my code wherever applicable.

Many thanks in advance.
Hi All,
I have a requiremnt which i am describing below:
There is a button called "Continue" on UI. When an user clicks on it it will redirect to some other page. But prior to that one validations need to be done. As you people can see in the screen shot which i attached here is there is checkbox along with the name of each subscription. So my requirement is if an user does not select any single subscription with "Active" status and if user clicks on proceed button an error message must be thrown "Please select al least one active subscription".
I am attaching the corresponding code and Visual force page with the screen shot.
public with sharing class AccountActionsWrapper
{       
    public String contextItem{get;set;}   
    public set<Id> selectedContactIds{get;set;}
    public String accountName {get; set;}
    public string accountid;
    public String selectedActions{get;set;}
    public boolean AccountBool{get;set;}
    public List<Account> accounts {get; set;}
    public List<csord__Service__c> vLstServ{ get; set; }
    public Id acctId {get; set;}
    public integer size{get;set;}
    public Map<Id, List<csord__Service__c>> memIdServListMap { get; set; }
    public integer noOfRecords{get;set;}
    public Date dat {get;set;}
    Set<Id> SubIds = new Set<Id>();
    public boolean Display{get;set;}
     Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public List<csord__Subscription__c>vLstSubscriptions{get;set;}
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;} 
    public Boolean isCancel{get;set;}
    public String query {get; set;}
    public String dateError {get;set;}
    public String currentDateValue { get; set; }

    public ApexPages.StandardSetController setCon {
        get{
            if(setCon == null){
           size =20; 
           accountid=ApexPages.currentPage().getParameters().get('id');
           selectedContactIds= new Set<Id>();       
           setCon= new ApexPages.StandardSetController( [select Id, Name,csord__Status__c,MACD_in_progress__c , csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid] );
           this.setCon.setpageNumber(1);
           setCon.setPageSize(size);
           noOfRecords = setCon.getResultSize();            
            }
            return setCon;
        }set;
    }
    
     public AccountActionsWrapper() 
     {
       selectedActions='Take Over';
       if(selectedActions=='Take Over')
       {
          AccountBool=true; 
       } 
      }
        
    public List<SelectOption> getActions() {
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
    }
    public void getDisplayAccount()
    {
        if(selectedActions!='Take Over')
        {
           AccountBool=false; 
        }
        else
        {
             AccountBool=true;
        }
    }
    
    //function to get date value    
     public void getValue(){
      System.debug('*************'+currentDateValue);
      
    
     }
     
     //Function to retrieving account detail in pop-up upon clicking on Lookup in VF page
     public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }   
    
    public void doSelectItem()
    {
      this.selectedContactIds.add(this.contextItem);
    } 
    public void doDeselectItem()
    {
      this.selectedContactIds.remove(this.contextItem);
    } 
    public Integer getSelectedCount()
    {
      return this.selectedContactIds.size();
    }
    public void doNext()
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
    } 
    public void doPrevious()
    {
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doStart() 
    { 
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doEnd() 
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
   }
     
    public List<wrapSubscription> getSubscriptions()
    { 
        
        List<wrapSubscription> rows = new List<wrapSubscription>(); 
        //vLstSubscriptions = [select Id, Name,csord__Status__c, csord__Account__c,(select Id,Billing_Account_Number__c from csord__Services__r) from csord__Subscription__c where csord__Account__c=:accountid limit 100];
        for(sObject r : this.setCon.getRecords())
        {
            csord__Subscription__c c = (csord__Subscription__c)r;
            wrapSubscription row = new wrapSubscription(c,vLstServ);
            if(this.selectedContactIds.contains(c.Id))
            {
                row.selected=true;
            }
            else
            {
                row.selected=false;
            }
            rows.add(row);
        }
        return rows;
         
    }
    public PageReference cancel()
    {
        return new PageReference('/'+accountid);
    }
    public Boolean getHasPrevious()
    { 
        return this.setCon.getHasPrevious();
    } 
    public Boolean getHasNext()
    {
       return this.setCon.getHasNext(); 
    }  
    public Integer getPageNumber()
    {
       return this.setCon.getPageNumber();
    } 
    Public Integer getTotalPages()
    {
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
        Decimal pages = totalSize/pageSize; 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }  
    public class wrapSubscription
    { 
        public csord__Subscription__c sub {get; set;}        
        public Boolean selected {get; set;}
        public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription(csord__Subscription__c c,List<csord__Service__c> vLstServ)
        {
            this.sub=c;
            this.Serv=vLstServ;
            this.selected=false;
        }
 
    }
}
<apex:page docType="html-5.0" controller="AccountActionsWrapper" sidebar="false" showHeader="false" id="pg" >

<head>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
</head>


<!--for mm/dd/yyyy format-->
<!--<script>
       $(function(){
        $('.datepicker').datepicker({
             minDate: 0 
         }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>-->

<!--for dd/mm/yyyy format-->
<script>
       $(function(){
        $('.datepicker').datepicker({ minDate: 0 , dateFormat: 'dd/mm/yy' }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>


<script>
    var newWin=null;
    function openLookupPopup(name, id)
    {
        var url="/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
        newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
    }
                  
    function closeLookupPopup()
    {
       if (null!=newWin)
       {
          newWin.close();
       }  
    }
    
  
    
     function doCheckboxChange(cb,itemId){ 
            if(cb.checked==true){
                aSelectItem(itemId);
            }
            else{
                aDeselectItem(itemId);
            }
        }
</script>

    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
   
    <apex:form >
    <apex:pageBlock >    
      <apex:pageBlockSection >    
        <apex:pageBlockSectionItem >
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1" >
                <apex:selectOptions value="{!Actions}"/>
                <apex:actionSupport event="onchange" action="{!getDisplayAccount}" reRender="panel"/>             
            </apex:selectList>
           </apex:pageBlockSectionItem>
           </apex:pageBlockSection>
      <apex:outputPanel >        
       <apex:pageBlockSection >     
           <apex:pageBlockSectionItem >          
           <apex:outputLabel value="Target Account"/>        
           <apex:outputPanel id="panel" >
            <apex:inputHidden value="{!acctId}" id="targetId"/>
            <apex:inputText size="40" value="{!accountName}" id="targetName" onFocus="this.blur()" disabled="{!!AccountBool}"/>&nbsp;
            
            <apex:outputLink rendered="{!AccountBool}" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</apex:outputLink>                    
          </apex:outputPanel>          
      </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      </apex:outputPanel>
               <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                <!--Date: <apex:input type="date" value="{!dat}" required="false"/>--> 
                Effective From:<apex:inputText id="datepicker" styleClass="datepicker"  value="{!currentDateValue}" required="false"/>              
            </apex:pageBlockSectionItem>           
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>       
    </apex:pageBlock>   
        
        <!-- handle selected item -->
        <apex:actionFunction name="aSelectItem" action="{!doSelectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <!-- handle deselected item -->
        <apex:actionFunction name="aDeselectItem" action="{!doDeselectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>        
         <apex:pageBlock title="Select Subscriptions" id="mpb">        
            <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
            <apex:pageBlockTable value="{!Subscriptions}" var="c">
                <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>                       
                            <apex:inputCheckbox value="{!c.selected}" id="inputId" disabled="{!NOT(c.sub.csord__Status__c=='Active') && (c.sub.MACD_in_progress__c=False)}" onchange="doCheckboxChange(this,'{!c.sub.Id}')"/>
                            
                    </apex:column>           
                 <apex:column headerValue="Subscription Name" >                       
                       <apex:outputLink value="/{!c.sub.Id}" target="_blank"> {!c.sub.Name} </apex:outputLink>
                   </apex:column>
                <apex:column value="{!c.sub.csord__Status__c}"/>                
                           
            </apex:pageBlockTable>
            </apex:pageblockSection>
           
        <apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}" title="First Page"/>
        <apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
        <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
        <apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next Page"/>
        <apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last Page"/>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Continue "  />
                <apex:commandButton value="Back" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
        </apex:pageBlock>        
    </apex:form>
</apex:page>
screen shot

This forum has helped me out earlier also and i am very hopeful that you people will help me out this time also.
Please fine tune my code wherever applicable.

Many thanks in advance.

 
Hi All,
I have a requiremnt which i am describing below:
There is a button called "Continue" on UI. When an user clicks on it it will redirect to some other page. But prior to that one validations need to be done. As you people can see in the screen shot which i attached here is there is checkbox along with the name of each subscription. So my requirement is if an user does not select any single subscription with "Active" status and if user clicks on proceed button an error message must be thrown "Please select al least one active subscription".
I am attaching the corresponding code and Visual force page with the screen shot.
public with sharing class AccountActionsWrapper
{       
    public String contextItem{get;set;}   
    public set<Id> selectedContactIds{get;set;}
    public String accountName {get; set;}
    public string accountid;
    public String selectedActions{get;set;}
    public boolean AccountBool{get;set;}
    public List<Account> accounts {get; set;}
    public List<csord__Service__c> vLstServ{ get; set; }
    public Id acctId {get; set;}
    public integer size{get;set;}
    public Map<Id, List<csord__Service__c>> memIdServListMap { get; set; }
    public integer noOfRecords{get;set;}
    public Date dat {get;set;}
    Set<Id> SubIds = new Set<Id>();
    public boolean Display{get;set;}
     Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public List<csord__Subscription__c>vLstSubscriptions{get;set;}
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;} 
    public Boolean isCancel{get;set;}
    public String query {get; set;}
    public String dateError {get;set;}
    public String currentDateValue { get; set; }

    public ApexPages.StandardSetController setCon {
        get{
            if(setCon == null){
           size =20; 
           accountid=ApexPages.currentPage().getParameters().get('id');
           selectedContactIds= new Set<Id>();       
           setCon= new ApexPages.StandardSetController( [select Id, Name,csord__Status__c,MACD_in_progress__c , csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid] );
           this.setCon.setpageNumber(1);
           setCon.setPageSize(size);
           noOfRecords = setCon.getResultSize();            
            }
            return setCon;
        }set;
    }
    
     public AccountActionsWrapper() 
     {
       selectedActions='Take Over';
       if(selectedActions=='Take Over')
       {
          AccountBool=true; 
       } 
      }
        
    public List<SelectOption> getActions() {
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
    }
    public void getDisplayAccount()
    {
        if(selectedActions!='Take Over')
        {
           AccountBool=false; 
        }
        else
        {
             AccountBool=true;
        }
    }
    
    //function to get date value    
     public void getValue(){
      System.debug('*************'+currentDateValue);
      
    
     }
     
     //Function to retrieving account detail in pop-up upon clicking on Lookup in VF page
     public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }   
    
    public void doSelectItem()
    {
      this.selectedContactIds.add(this.contextItem);
    } 
    public void doDeselectItem()
    {
      this.selectedContactIds.remove(this.contextItem);
    } 
    public Integer getSelectedCount()
    {
      return this.selectedContactIds.size();
    }
    public void doNext()
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
    } 
    public void doPrevious()
    {
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doStart() 
    { 
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doEnd() 
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
   }
     
    public List<wrapSubscription> getSubscriptions()
    { 
        
        List<wrapSubscription> rows = new List<wrapSubscription>(); 
        //vLstSubscriptions = [select Id, Name,csord__Status__c, csord__Account__c,(select Id,Billing_Account_Number__c from csord__Services__r) from csord__Subscription__c where csord__Account__c=:accountid limit 100];
        for(sObject r : this.setCon.getRecords())
        {
            csord__Subscription__c c = (csord__Subscription__c)r;
            wrapSubscription row = new wrapSubscription(c,vLstServ);
            if(this.selectedContactIds.contains(c.Id))
            {
                row.selected=true;
            }
            else
            {
                row.selected=false;
            }
            rows.add(row);
        }
        return rows;
         
    }
    public PageReference cancel()
    {
        return new PageReference('/'+accountid);
    }
    public Boolean getHasPrevious()
    { 
        return this.setCon.getHasPrevious();
    } 
    public Boolean getHasNext()
    {
       return this.setCon.getHasNext(); 
    }  
    public Integer getPageNumber()
    {
       return this.setCon.getPageNumber();
    } 
    Public Integer getTotalPages()
    {
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
        Decimal pages = totalSize/pageSize; 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }  
    public class wrapSubscription
    { 
        public csord__Subscription__c sub {get; set;}        
        public Boolean selected {get; set;}
        public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription(csord__Subscription__c c,List<csord__Service__c> vLstServ)
        {
            this.sub=c;
            this.Serv=vLstServ;
            this.selected=false;
        }
 
    }
}
<apex:page docType="html-5.0" controller="AccountActionsWrapper" sidebar="false" showHeader="false" id="pg" >

<head>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
</head>


<!--for mm/dd/yyyy format-->
<!--<script>
       $(function(){
        $('.datepicker').datepicker({
             minDate: 0 
         }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>-->

<!--for dd/mm/yyyy format-->
<script>
       $(function(){
        $('.datepicker').datepicker({ minDate: 0 , dateFormat: 'dd/mm/yy' }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>


<script>
    var newWin=null;
    function openLookupPopup(name, id)
    {
        var url="/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
        newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
    }
                  
    function closeLookupPopup()
    {
       if (null!=newWin)
       {
          newWin.close();
       }  
    }
    
  
    
     function doCheckboxChange(cb,itemId){ 
            if(cb.checked==true){
                aSelectItem(itemId);
            }
            else{
                aDeselectItem(itemId);
            }
        }
</script>

    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
   
    <apex:form >
    <apex:pageBlock >    
      <apex:pageBlockSection >    
        <apex:pageBlockSectionItem >
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1" >
                <apex:selectOptions value="{!Actions}"/>
                <apex:actionSupport event="onchange" action="{!getDisplayAccount}" reRender="panel"/>             
            </apex:selectList>
           </apex:pageBlockSectionItem>
           </apex:pageBlockSection>
      <apex:outputPanel >        
       <apex:pageBlockSection >     
           <apex:pageBlockSectionItem >          
           <apex:outputLabel value="Target Account"/>        
           <apex:outputPanel id="panel" >
            <apex:inputHidden value="{!acctId}" id="targetId"/>
            <apex:inputText size="40" value="{!accountName}" id="targetName" onFocus="this.blur()" disabled="{!!AccountBool}"/>&nbsp;
            
            <apex:outputLink rendered="{!AccountBool}" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</apex:outputLink>                    
          </apex:outputPanel>          
      </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      </apex:outputPanel>
               <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                <!--Date: <apex:input type="date" value="{!dat}" required="false"/>--> 
                Effective From:<apex:inputText id="datepicker" styleClass="datepicker"  value="{!currentDateValue}" required="false"/>              
            </apex:pageBlockSectionItem>           
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>       
    </apex:pageBlock>   
        
        <!-- handle selected item -->
        <apex:actionFunction name="aSelectItem" action="{!doSelectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <!-- handle deselected item -->
        <apex:actionFunction name="aDeselectItem" action="{!doDeselectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>        
         <apex:pageBlock title="Select Subscriptions" id="mpb">        
            <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
            <apex:pageBlockTable value="{!Subscriptions}" var="c">
                <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>                       
                            <apex:inputCheckbox value="{!c.selected}" id="inputId" disabled="{!NOT(c.sub.csord__Status__c=='Active') && (c.sub.MACD_in_progress__c=False)}" onchange="doCheckboxChange(this,'{!c.sub.Id}')"/>
                            
                    </apex:column>           
                 <apex:column headerValue="Subscription Name" >                       
                       <apex:outputLink value="/{!c.sub.Id}" target="_blank"> {!c.sub.Name} </apex:outputLink>
                   </apex:column>
                <apex:column value="{!c.sub.csord__Status__c}"/>                
                           
            </apex:pageBlockTable>
            </apex:pageblockSection>
           
        <apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}" title="First Page"/>
        <apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
        <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
        <apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next Page"/>
        <apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last Page"/>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Continue "  />
                <apex:commandButton value="Back" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
        </apex:pageBlock>        
    </apex:form>
</apex:page>
screen shot
This forum has helped me out earlier also and i am very hopeful that you people will help me out this time also.
Please fine tune my code wherever applicable.

Many thanks in advance.
 
Hi All,
I have a requiremnt which i am describing below:
There is a button called "Continue" on UI. When an user clicks on it it will redirect to some other page. But prior to that one validations need to be done. As you people can see in the screen shot which i attached here is there is checkbox along with the name of each subscription. So my requirement is if an user does not select any single subscription with "Active" status and if user clicks on proceed button an error message must be thrown "Please select al least one active subscription".
I am attaching the corresponding code and Visual force page with the screen shot.
public with sharing class AccountActionsWrapper
{       
    public String contextItem{get;set;}   
    public set<Id> selectedContactIds{get;set;}
    public String accountName {get; set;}
    public string accountid;
    public String selectedActions{get;set;}
    public boolean AccountBool{get;set;}
    public List<Account> accounts {get; set;}
    public List<csord__Service__c> vLstServ{ get; set; }
    public Id acctId {get; set;}
    public integer size{get;set;}
    public Map<Id, List<csord__Service__c>> memIdServListMap { get; set; }
    public integer noOfRecords{get;set;}
    public Date dat {get;set;}
    Set<Id> SubIds = new Set<Id>();
    public boolean Display{get;set;}
     Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public List<csord__Subscription__c>vLstSubscriptions{get;set;}
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;} 
    public Boolean isCancel{get;set;}
    public String query {get; set;}
    public String dateError {get;set;}
    public String currentDateValue { get; set; }

    public ApexPages.StandardSetController setCon {
        get{
            if(setCon == null){
           size =20; 
           accountid=ApexPages.currentPage().getParameters().get('id');
           selectedContactIds= new Set<Id>();       
           setCon= new ApexPages.StandardSetController( [select Id, Name,csord__Status__c,MACD_in_progress__c , csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid] );
           this.setCon.setpageNumber(1);
           setCon.setPageSize(size);
           noOfRecords = setCon.getResultSize();            
            }
            return setCon;
        }set;
    }
    
     public AccountActionsWrapper() 
     {
       selectedActions='Take Over';
       if(selectedActions=='Take Over')
       {
          AccountBool=true; 
       } 
      }
        
    public List<SelectOption> getActions() {
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
    }
    public void getDisplayAccount()
    {
        if(selectedActions!='Take Over')
        {
           AccountBool=false; 
        }
        else
        {
             AccountBool=true;
        }
    }
    
    //function to get date value    
     public void getValue(){
      System.debug('*************'+currentDateValue);
      
    
     }
     
     //Function to retrieving account detail in pop-up upon clicking on Lookup in VF page
     public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }   
    
    public void doSelectItem()
    {
      this.selectedContactIds.add(this.contextItem);
    } 
    public void doDeselectItem()
    {
      this.selectedContactIds.remove(this.contextItem);
    } 
    public Integer getSelectedCount()
    {
      return this.selectedContactIds.size();
    }
    public void doNext()
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
    } 
    public void doPrevious()
    {
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doStart() 
    { 
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doEnd() 
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
   }
     
    public List<wrapSubscription> getSubscriptions()
    { 
        
        List<wrapSubscription> rows = new List<wrapSubscription>(); 
        //vLstSubscriptions = [select Id, Name,csord__Status__c, csord__Account__c,(select Id,Billing_Account_Number__c from csord__Services__r) from csord__Subscription__c where csord__Account__c=:accountid limit 100];
        for(sObject r : this.setCon.getRecords())
        {
            csord__Subscription__c c = (csord__Subscription__c)r;
            wrapSubscription row = new wrapSubscription(c,vLstServ);
            if(this.selectedContactIds.contains(c.Id))
            {
                row.selected=true;
            }
            else
            {
                row.selected=false;
            }
            rows.add(row);
        }
        return rows;
         
    }
    public PageReference cancel()
    {
        return new PageReference('/'+accountid);
    }
    public Boolean getHasPrevious()
    { 
        return this.setCon.getHasPrevious();
    } 
    public Boolean getHasNext()
    {
       return this.setCon.getHasNext(); 
    }  
    public Integer getPageNumber()
    {
       return this.setCon.getPageNumber();
    } 
    Public Integer getTotalPages()
    {
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
        Decimal pages = totalSize/pageSize; 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }  
    public class wrapSubscription
    { 
        public csord__Subscription__c sub {get; set;}        
        public Boolean selected {get; set;}
        public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription(csord__Subscription__c c,List<csord__Service__c> vLstServ)
        {
            this.sub=c;
            this.Serv=vLstServ;
            this.selected=false;
        }
 
    }
}
<apex:page docType="html-5.0" controller="AccountActionsWrapper" sidebar="false" showHeader="false" id="pg" >

<head>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
</head>


<!--for mm/dd/yyyy format-->
<!--<script>
       $(function(){
        $('.datepicker').datepicker({
             minDate: 0 
         }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>-->

<!--for dd/mm/yyyy format-->
<script>
       $(function(){
        $('.datepicker').datepicker({ minDate: 0 , dateFormat: 'dd/mm/yy' }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>


<script>
    var newWin=null;
    function openLookupPopup(name, id)
    {
        var url="/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
        newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
    }
                  
    function closeLookupPopup()
    {
       if (null!=newWin)
       {
          newWin.close();
       }  
    }
    
  
    
     function doCheckboxChange(cb,itemId){ 
            if(cb.checked==true){
                aSelectItem(itemId);
            }
            else{
                aDeselectItem(itemId);
            }
        }
</script>

    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
   
    <apex:form >
    <apex:pageBlock >    
      <apex:pageBlockSection >    
        <apex:pageBlockSectionItem >
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1" >
                <apex:selectOptions value="{!Actions}"/>
                <apex:actionSupport event="onchange" action="{!getDisplayAccount}" reRender="panel"/>             
            </apex:selectList>
           </apex:pageBlockSectionItem>
           </apex:pageBlockSection>
      <apex:outputPanel >        
       <apex:pageBlockSection >     
           <apex:pageBlockSectionItem >          
           <apex:outputLabel value="Target Account"/>        
           <apex:outputPanel id="panel" >
            <apex:inputHidden value="{!acctId}" id="targetId"/>
            <apex:inputText size="40" value="{!accountName}" id="targetName" onFocus="this.blur()" disabled="{!!AccountBool}"/>&nbsp;
            
            <apex:outputLink rendered="{!AccountBool}" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</apex:outputLink>                    
          </apex:outputPanel>          
      </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      </apex:outputPanel>
               <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                <!--Date: <apex:input type="date" value="{!dat}" required="false"/>--> 
                Effective From:<apex:inputText id="datepicker" styleClass="datepicker"  value="{!currentDateValue}" required="false"/>              
            </apex:pageBlockSectionItem>           
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>       
    </apex:pageBlock>   
        
        <!-- handle selected item -->
        <apex:actionFunction name="aSelectItem" action="{!doSelectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <!-- handle deselected item -->
        <apex:actionFunction name="aDeselectItem" action="{!doDeselectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>        
         <apex:pageBlock title="Select Subscriptions" id="mpb">        
            <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
            <apex:pageBlockTable value="{!Subscriptions}" var="c">
                <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>                       
                            <apex:inputCheckbox value="{!c.selected}" id="inputId" disabled="{!NOT(c.sub.csord__Status__c=='Active') && (c.sub.MACD_in_progress__c=False)}" onchange="doCheckboxChange(this,'{!c.sub.Id}')"/>
                            
                    </apex:column>           
                 <apex:column headerValue="Subscription Name" >                       
                       <apex:outputLink value="/{!c.sub.Id}" target="_blank"> {!c.sub.Name} </apex:outputLink>
                   </apex:column>
                <apex:column value="{!c.sub.csord__Status__c}"/>                
                           
            </apex:pageBlockTable>
            </apex:pageblockSection>
           
        <apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}" title="First Page"/>
        <apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
        <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
        <apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next Page"/>
        <apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last Page"/>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Continue "  />
                <apex:commandButton value="Back" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
        </apex:pageBlock>        
    </apex:form>
</apex:page>
screen shot

This forum has helped me out earlier also and i am very hopeful that you people will help me out this time also.
Please fine tune my code wherever applicable.

Many thanks in advance.


 
Hi All,
I have a requiremnt to craete a date field on Vf page and it should be dummy one i.e. it is not present at any object level.Moreover,a pop up date  picker will be available for date selection and  an user cant select a date of past in date picker list in visual force page and if he selects/enters a date of past an error msg should be displayed.
Note:This date field on Vf page is a dummy field and is not present on object level.
I am attaching my Vf code and controller plz insert the necessary lines of codes for the same.
Many thanks in advance.
public class HarjeetWrapper{
             private Set<Id> selectedContactIds;
             public String selectedActions{get;set;}
            
              

            


            public ApexPages.StandardSetController setCon {
            get {
                if(setCon == null) {
                    setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                      [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]));
                             }
                            setCon.setPageSize(20);
                        return setCon;
                }
        set;
    }
    public List<csord__Subscription__c > getWrapSubscriptionList() {
         
         // setCon.setpagesize(20);
         setCon.setpageNumber(1);
         return (List<csord__Subscription__c >) setCon.getRecords();
    }
    public Integer getPageNumber(){
 
        return this.setCon.getPageNumber();
 
    }
    

 


   Public Integer getTotalPages(){
 
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
 
        Decimal pages = totalSize/pageSize;
 
        return (Integer)pages.round(System.RoundingMode.CEILING);
     }
 

    //Our collection of the class/wrapper objects wrapAccount
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;}
    public Boolean isCancel{get;set;}
    public string accountid;
    
    
    public HarjeetWrapper(){
      accountid=ApexPages.currentPage().getParameters().get('id');
        if(wrapSubscriptionList == null) {
           wrapSubscriptionList= new List<wrapSubscription>();
            for(csord__Subscription__c s: [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapSubscriptionList.add(new wrapSubscription(s));
            }
        }
    }
    
    
    public void processSelected() {
    selectedSubscriptions = new List<csord__Subscription__c>();
 
        for(wrapSubscription wrapSubscriptionObj : wrapSubscriptionList) {
            if(wrapSubscriptionObj.selected == true) {
                selectedSubscriptions.add(wrapSubscriptionObj.sub);
            }
        }
    }
    
    public PageReference cancel(){
        return new PageReference('/'+accountid);
    }
    
    public void next(){

    if(this.setCon.getHasNext())
        this.setCon.next();

}

 public void previous(){

    if(this.setCon.getHasPrevious())
        this.setCon.previous();

}
        public List<SelectOption> getCountriesOptions() {
        List<SelectOption> countryOptions = new List<SelectOption>();
        countryOptions.add(new SelectOption('','-None-'));
        countryOptions.add(new SelectOption('Take Over','Take Over'));
        countryOptions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        countryOptions.add(new SelectOption('Move','Move'));
        /*countryOptions.add(new SelectOption('Germany','Germany'));
        countryOptions.add(new SelectOption('Ireland','Ireland'));*/
 
        return countryOptions;
}




                         
 
    // This is our wrapper/container class. In this example a wrapper class contains both the standard salesforce object Account and a Boolean value
    public class wrapSubscription {
        public csord__Subscription__c sub {get; set;}
        public Boolean selected {get; set;}
 
        public wrapSubscription(csord__Subscription__c s) {
            sub = s;
            selected = false;
        }
    }
}
<apex:page docType="html-5.0" controller="HarjeetWrapper" sidebar="false" showHeader="false">



    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
    <apex:form >
        <apex:pageBlock >
        <apex:pageBlockSection >
        <apex:pageBlockSectionItem >
        <!-- <apex:outputText value="{!selectedActions}" label="You have selected:"/>-->
        <!--<apex:outputText label="Select the Action:"/>-->
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1">
                <apex:selectOption itemValue="Take Over" itemLabel="Take Over"/>
                <apex:selectOption itemValue="Invoice Switch" itemLabel="Invoice Switch"/>
                <apex:selectOption itemValue="Move" itemLabel="Move"/>
            </apex:selectList>
            <!--</apex:outputPanel>-->
            </apex:pageBlockSectionItem>
           </apex:pageBlockSection> 
           
 
    
        <apex:pageBlock title="Select Subscription"  >
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Proceed " action="{!processSelected}" />
                <apex:commandButton value="Cancel" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
       <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
             <apex:pageBlockTable value="{!wrapSubscriptionList}" var="subWrap">
                    <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')" />
                        </apex:facet>
                        <!--<apex:inputCheckbox value="{!subWrap.selected}" id="inputId"/>-->
                                <apex:inputCheckbox value="{!subWrap.selected}" id="inputId" disabled="{!NOT(subWrap.sub.csord__Status__c=='Active')}" />
                    </apex:column>
                    
                    <!--<apex:column value="{!subWrap.sub.Name}" />-->
                    <apex:column headerValue="Subscription Name" > 
                        <!--<apex:commandLink value="{!subWrap.sub.Name}" action="/{!subWrap.sub.Id}"/>-->
                       <apex:outputLink value="/{!subWrap.sub.Id}" target="_blank"> {!subWrap.sub.Name} </apex:outputLink>
                   </apex:column>
                     <apex:column value="{!subWrap.sub.csord__Status__c}" />
                    <apex:column value="{!subWrap.sub.csord__Account__c}" />
                </apex:pageBlockTable>
                </apex:pageblockSection>
             <apex:commandButton rendered="{!setCon.hasPrevious}" value="first" action="{!setCon.first}"/>
            <apex:commandButton rendered="{!setCon.hasPrevious}" value="Previous" action="{!setCon.previous}"/>
            <apex:outputLabel value=" (page {!pageNumber} of {!totalPages})"/>
            <apex:outputText rendered="{!(setCon.pageNumber * setCon.pageSize) < setCon.ResultSize}" value="{!setCon.pageNumber * setCon.pageSize} Of {!setCon.ResultSize}"></apex:outputText>
            <apex:outputText rendered="{!(setCon.pageNumber * setCon.pageSize) >= setCon.ResultSize}" value="{!setCon.ResultSize} Of {!setCon.ResultSize}"></apex:outputText>
            <apex:commandButton rendered="{!setCon.hasNext}" value="next" action="{!setCon.next}"/>
            <apex:commandButton rendered="{!setCon.hasNext}" value="last" action="{!setCon.last}"/>

     <apex:pageBlock />
                
                
                <apex:pageblockSection title="Selected Subscriptions" collapsible="false" columns="1" >
                   <apex:pageBlockTable value="{!selectedSubscriptions}" var="c" id="table2" title="Selected Subscriptions" width="100%">
                    <!--<apex:column value="{!c.Name}" headerValue="Subscription Name"/>-->
                    <apex:column headerValue="Subscription Name" > 
                        <apex:commandLink value="{!c.Name}" action="/{!c.Id}" target="_blank"/> 
                      </apex:column> 
                    <apex:column value="{!c.csord__Status__c}" headerValue="Status"/>
                    <apex:column value="{!c.csord__Account__c}" headerValue="Account"/>
                </apex:pageBlockTable>
            

            </apex:pageblockSection>
        </apex:pageBlock>
    </apex:form>
 
</apex:page>
screen shot
I am attaching my actual requirement page snap,plz refer the snap shot so that you people will have a better idea about date field ui and functionality.
Many thanks in advance.


 
Hi All,
I have an urgent requirement for test class creation.I have posted my controller code here.If possible,any one from developer community can provide me a test class code for my controller.It would be really very helpful for me as i am very new to salesforce and this is very urgent requirement needs to complete asap.
public class ControllerWrapper{

private Set<Id> selectedContactIds;

//Our collection of the class/wrapper objects 
public List<wrapSubscription> wrapSubscriptionList {get; set;}
public List<csord__Subscription__c> selectedSubscriptions{get;set;}
public Boolean isCancel{get;set;}
public string accountid;
public String selectedActions{get;set;}
public Date dat {get;set;}
public String query {get; set;}
public List<Account> accounts {get; set;}
public Id acctId {get; set;}
public String accountName {get; set;}
    
//Constructor class   
public ControllerWrapper(){
    accountid=ApexPages.currentPage().getParameters().get('id');
        if(wrapSubscriptionList == null) {
           wrapSubscriptionList= new List<wrapSubscription>();
            for(csord__Subscription__c s: [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid LIMIT 20]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapSubscriptionList.add(new wrapSubscription(s));
            }
        }
    }

//function for calling dummy lookup field which is created on vf page 
public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }
    

//function for selection of values from dummy picklist field "Action"
public List<SelectOption> getActionsOptions() {
        List<SelectOption> actionOptions = new List<SelectOption>();
        actionOptions.add(new SelectOption('','-None-'));
        actionOptions.add(new SelectOption('Take Over','Take Over'));
        actionOptions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        actionOptions.add(new SelectOption('Move','Move'));
                return actionOptions;
}
   

//Function for pagination logic
public ApexPages.StandardSetController setCon {
get {
    if(setCon == null) {
         setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
            [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]));
                             }
                        return setCon;
                }
        set;
    }
public List<csord__Subscription__c > getWrapSubscriptionList() {
         
          setCon.setpagesize(20);
         setCon.setpageNumber(1);
         return (List<csord__Subscription__c >) setCon.getRecords();
    }


//Method for obtaining current page no.
public Integer getPageNumber(){
 
        return this.setCon.getPageNumber();
 
    }
    

 

//Function returns the total no pages 
Public Integer getTotalPages(){
 
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
 
        Decimal pages = totalSize/pageSize;
 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }             
                  

     
//Function to call Proceed button    
public void processSelected() {
    selectedSubscriptions = new List<csord__Subscription__c>();
 
        for(wrapSubscription wrapSubscriptionObj : wrapSubscriptionList) {
            if(wrapSubscriptionObj.selected == true) {
                selectedSubscriptions.add(wrapSubscriptionObj.sub);
            }
        }
    }
    
//Function to process the Cancel Button
public PageReference cancel(){
        return new PageReference('/'+accountid);
    }
    
//Method for calling Next Button
public void next(){

    if(this.setCon.getHasNext())
        this.setCon.next();

    }

//Method for calling Previous Button
public void previous(){

    if(this.setCon.getHasPrevious())
        this.setCon.previous();

    }
    
    
 
                         
 
// This is our wrapper/container class. In this example a wrapper class contains both the custom object Subscription and a Boolean value
public class wrapSubscription {
        public csord__Subscription__c sub {get; set;}
        public Boolean selected {get; set;}
 
        public wrapSubscription(csord__Subscription__c s) {
            sub = s;
            selected = false;
        }
    }
}
You people have helped me alot earlier and this time also i am very optimistic about the same.I am seeking help from last 2 days here.
This is urgent requiremnt.
Many thanks in advance.
 
Hi All,
I have an urgent requirement for test class creation.I have posted my controller code here.If possible,any one from developer community can provide me a test class code for my controller.It would be really very helpful for me as i am very new to salesforce and this is very urgent requirement needs to complete asap.
public class ControllerWrapper{

private Set<Id> selectedContactIds;

//Our collection of the class/wrapper objects 
public List<wrapSubscription> wrapSubscriptionList {get; set;}
public List<csord__Subscription__c> selectedSubscriptions{get;set;}
public Boolean isCancel{get;set;}
public string accountid;
public String selectedActions{get;set;}
public Date dat {get;set;}
public String query {get; set;}
public List<Account> accounts {get; set;}
public Id acctId {get; set;}
public String accountName {get; set;}
    
//Constructor class   
public ControllerWrapper(){
    accountid=ApexPages.currentPage().getParameters().get('id');
        if(wrapSubscriptionList == null) {
           wrapSubscriptionList= new List<wrapSubscription>();
            for(csord__Subscription__c s: [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid LIMIT 20]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapSubscriptionList.add(new wrapSubscription(s));
            }
        }
    }

//function for calling dummy lookup field which is created on vf page 
public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }
    

//function for selection of values from dummy picklist field "Action"
public List<SelectOption> getActionsOptions() {
        List<SelectOption> actionOptions = new List<SelectOption>();
        actionOptions.add(new SelectOption('','-None-'));
        actionOptions.add(new SelectOption('Take Over','Take Over'));
        actionOptions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        actionOptions.add(new SelectOption('Move','Move'));
                return actionOptions;
}
   

//Function for pagination logic
public ApexPages.StandardSetController setCon {
get {
    if(setCon == null) {
         setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
            [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]));
                             }
                        return setCon;
                }
        set;
    }
public List<csord__Subscription__c > getWrapSubscriptionList() {
         
          setCon.setpagesize(20);
         setCon.setpageNumber(1);
         return (List<csord__Subscription__c >) setCon.getRecords();
    }


//Method for obtaining current page no.
public Integer getPageNumber(){
 
        return this.setCon.getPageNumber();
 
    }
    

 

//Function returns the total no pages 
Public Integer getTotalPages(){
 
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
 
        Decimal pages = totalSize/pageSize;
 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }             
                  

     
//Function to call Proceed button    
public void processSelected() {
    selectedSubscriptions = new List<csord__Subscription__c>();
 
        for(wrapSubscription wrapSubscriptionObj : wrapSubscriptionList) {
            if(wrapSubscriptionObj.selected == true) {
                selectedSubscriptions.add(wrapSubscriptionObj.sub);
            }
        }
    }
    
//Function to process the Cancel Button
public PageReference cancel(){
        return new PageReference('/'+accountid);
    }
    
//Method for calling Next Button
public void next(){

    if(this.setCon.getHasNext())
        this.setCon.next();

    }

//Method for calling Previous Button
public void previous(){

    if(this.setCon.getHasPrevious())
        this.setCon.previous();

    }
    
    
 
                         
 
// This is our wrapper/container class. In this example a wrapper class contains both the custom object Subscription and a Boolean value
public class wrapSubscription {
        public csord__Subscription__c sub {get; set;}
        public Boolean selected {get; set;}
 
        public wrapSubscription(csord__Subscription__c s) {
            sub = s;
            selected = false;
        }
    }
}
You people have helped me alot earlier and this time also i am very optimistic about the same.I am seeking help from last 2 days here.
This is urgent requiremnt.
Many thanks in advance.
 
Hi All,
I have a requiremnt that an user cant select a date of past in date picker list in visual force page and if he selects/enters a date of past an error msg should be displayed.
Note:This date field on Vf page is a dummy field and is not present on object level.
I am attaching my Vf code and controller along with my screen shot.
public class HarjeetWrapper{
             private Set<Id> selectedContactIds;
             public String selectedActions{get;set;}
             public Date dat {get;set;}
              

            


            public ApexPages.StandardSetController setCon {
            get {
                if(setCon == null) {
                    setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                      [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]));
                             }
                            setCon.setPageSize(20);
                        return setCon;
                }
        set;
    }
    public List<csord__Subscription__c > getWrapSubscriptionList() {
         
         // setCon.setpagesize(20);
         setCon.setpageNumber(1);
         return (List<csord__Subscription__c >) setCon.getRecords();
    }
    public Integer getPageNumber(){
 
        return this.setCon.getPageNumber();
 
    }
    

 


   Public Integer getTotalPages(){
 
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
 
        Decimal pages = totalSize/pageSize;
 
        return (Integer)pages.round(System.RoundingMode.CEILING);
     }
 

    //Our collection of the class/wrapper objects wrapAccount
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;}
    public Boolean isCancel{get;set;}
    public string accountid;
    
    
    public HarjeetWrapper(){
      accountid=ApexPages.currentPage().getParameters().get('id');
        if(wrapSubscriptionList == null) {
           wrapSubscriptionList= new List<wrapSubscription>();
            for(csord__Subscription__c s: [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapSubscriptionList.add(new wrapSubscription(s));
            }
        }
    }
    
    
    public void processSelected() {
    selectedSubscriptions = new List<csord__Subscription__c>();
 
        for(wrapSubscription wrapSubscriptionObj : wrapSubscriptionList) {
            if(wrapSubscriptionObj.selected == true) {
                selectedSubscriptions.add(wrapSubscriptionObj.sub);
            }
        }
    }
    
    public PageReference cancel(){
        return new PageReference('/'+accountid);
    }
    
    public void next(){

    if(this.setCon.getHasNext())
        this.setCon.next();

}

 public void previous(){

    if(this.setCon.getHasPrevious())
        this.setCon.previous();

}
        public List<SelectOption> getCountriesOptions() {
        List<SelectOption> countryOptions = new List<SelectOption>();
        countryOptions.add(new SelectOption('','-None-'));
        countryOptions.add(new SelectOption('Take Over','Take Over'));
        countryOptions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        countryOptions.add(new SelectOption('Move','Move'));
        /*countryOptions.add(new SelectOption('Germany','Germany'));
        countryOptions.add(new SelectOption('Ireland','Ireland'));*/
 
        return countryOptions;
}




                         
 
    // This is our wrapper/container class. In this example a wrapper class contains both the standard salesforce object Account and a Boolean value
    public class wrapSubscription {
        public csord__Subscription__c sub {get; set;}
        public Boolean selected {get; set;}
 
        public wrapSubscription(csord__Subscription__c s) {
            sub = s;
            selected = false;
        }
    }
}
<apex:page docType="html-5.0" controller="HarjeetWrapper" sidebar="false" showHeader="false">



    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
    <apex:form >
        <apex:pageBlock >
        <apex:pageBlockSection >
        <apex:pageBlockSectionItem >
        <!-- <apex:outputText value="{!selectedActions}" label="You have selected:"/>-->
        <!--<apex:outputText label="Select the Action:"/>-->
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1">
                <apex:selectOption itemValue="Take Over" itemLabel="Take Over"/>
                <apex:selectOption itemValue="Invoice Switch" itemLabel="Invoice Switch"/>
                <apex:selectOption itemValue="Move" itemLabel="Move"/>
            </apex:selectList>
            <!--</apex:outputPanel>-->
            </apex:pageBlockSectionItem>
           </apex:pageBlockSection> 
           <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                Date: <apex:input type="date" value="{!dat}" required="true" />
             </apex:pageBlockSectionItem>
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>
    </apex:pageBlock>
 
    
        <apex:pageBlock title="Select Subscription"  >
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Proceed " action="{!processSelected}" />
                <apex:commandButton value="Cancel" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
       <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
             <apex:pageBlockTable value="{!wrapSubscriptionList}" var="subWrap">
                    <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')" />
                        </apex:facet>
                        <!--<apex:inputCheckbox value="{!subWrap.selected}" id="inputId"/>-->
                                <apex:inputCheckbox value="{!subWrap.selected}" id="inputId" disabled="{!NOT(subWrap.sub.csord__Status__c=='Active')}" />
                    </apex:column>
                    
                    <!--<apex:column value="{!subWrap.sub.Name}" />-->
                    <apex:column headerValue="Subscription Name" > 
                        <!--<apex:commandLink value="{!subWrap.sub.Name}" action="/{!subWrap.sub.Id}"/>-->
                       <apex:outputLink value="/{!subWrap.sub.Id}" target="_blank"> {!subWrap.sub.Name} </apex:outputLink>
                   </apex:column>
                     <apex:column value="{!subWrap.sub.csord__Status__c}" />
                    <apex:column value="{!subWrap.sub.csord__Account__c}" />
                </apex:pageBlockTable>
                </apex:pageblockSection>
             <apex:commandButton rendered="{!setCon.hasPrevious}" value="first" action="{!setCon.first}"/>
            <apex:commandButton rendered="{!setCon.hasPrevious}" value="Previous" action="{!setCon.previous}"/>
            <apex:outputLabel value=" (page {!pageNumber} of {!totalPages})"/>
            <apex:outputText rendered="{!(setCon.pageNumber * setCon.pageSize) < setCon.ResultSize}" value="{!setCon.pageNumber * setCon.pageSize} Of {!setCon.ResultSize}"></apex:outputText>
            <apex:outputText rendered="{!(setCon.pageNumber * setCon.pageSize) >= setCon.ResultSize}" value="{!setCon.ResultSize} Of {!setCon.ResultSize}"></apex:outputText>
            <apex:commandButton rendered="{!setCon.hasNext}" value="next" action="{!setCon.next}"/>
            <apex:commandButton rendered="{!setCon.hasNext}" value="last" action="{!setCon.last}"/>

     <apex:pageBlock />
                
                
                <apex:pageblockSection title="Selected Subscriptions" collapsible="false" columns="1" >
                   <apex:pageBlockTable value="{!selectedSubscriptions}" var="c" id="table2" title="Selected Subscriptions" width="100%">
                    <!--<apex:column value="{!c.Name}" headerValue="Subscription Name"/>-->
                    <apex:column headerValue="Subscription Name" > 
                        <apex:commandLink value="{!c.Name}" action="/{!c.Id}" target="_blank"/> 
                      </apex:column> 
                    <apex:column value="{!c.csord__Status__c}" headerValue="Status"/>
                    <apex:column value="{!c.csord__Account__c}" headerValue="Account"/>
                </apex:pageBlockTable>
            

            </apex:pageblockSection>
        </apex:pageBlock>
    </apex:form>
 
</apex:page>
screen shot
Please help me out in this situation,i really need to solve this as soon as possible.
Many thanks in advance.
Note:Pls dont suggest/refer a link to me for this as i have gone through so many links but no luck.So pls look into my code which i have posted here and modify that accordingly.I am seeking help from last 4 days in this forum.


 
Hi All,
I have a requiremnt that an user cant select a date of past in date picker list in visual force page and if he selects/enters a date of past an error msg should be displayed.
Note:This date field on Vf page is a dummy field and is not present on object level.
I am attaching my Vf code and controller along with my screen shot.
public class HarjeetWrapper{
             private Set<Id> selectedContactIds;
             public String selectedActions{get;set;}
             public Date dat {get;set;}
              

            


            public ApexPages.StandardSetController setCon {
            get {
                if(setCon == null) {
                    setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                      [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]));
                             }
                            setCon.setPageSize(20);
                        return setCon;
                }
        set;
    }
    public List<csord__Subscription__c > getWrapSubscriptionList() {
         
         // setCon.setpagesize(20);
         setCon.setpageNumber(1);
         return (List<csord__Subscription__c >) setCon.getRecords();
    }
    public Integer getPageNumber(){
 
        return this.setCon.getPageNumber();
 
    }
    

 


   Public Integer getTotalPages(){
 
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
 
        Decimal pages = totalSize/pageSize;
 
        return (Integer)pages.round(System.RoundingMode.CEILING);
     }
 

    //Our collection of the class/wrapper objects wrapAccount
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;}
    public Boolean isCancel{get;set;}
    public string accountid;
    
    
    public HarjeetWrapper(){
      accountid=ApexPages.currentPage().getParameters().get('id');
        if(wrapSubscriptionList == null) {
           wrapSubscriptionList= new List<wrapSubscription>();
            for(csord__Subscription__c s: [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapSubscriptionList.add(new wrapSubscription(s));
            }
        }
    }
    
    
    public void processSelected() {
    selectedSubscriptions = new List<csord__Subscription__c>();
 
        for(wrapSubscription wrapSubscriptionObj : wrapSubscriptionList) {
            if(wrapSubscriptionObj.selected == true) {
                selectedSubscriptions.add(wrapSubscriptionObj.sub);
            }
        }
    }
    
    public PageReference cancel(){
        return new PageReference('/'+accountid);
    }
    
    public void next(){

    if(this.setCon.getHasNext())
        this.setCon.next();

}

 public void previous(){

    if(this.setCon.getHasPrevious())
        this.setCon.previous();

}
        public List<SelectOption> getCountriesOptions() {
        List<SelectOption> countryOptions = new List<SelectOption>();
        countryOptions.add(new SelectOption('','-None-'));
        countryOptions.add(new SelectOption('Take Over','Take Over'));
        countryOptions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        countryOptions.add(new SelectOption('Move','Move'));
        /*countryOptions.add(new SelectOption('Germany','Germany'));
        countryOptions.add(new SelectOption('Ireland','Ireland'));*/
 
        return countryOptions;
}




                         
 
    // This is our wrapper/container class. In this example a wrapper class contains both the standard salesforce object Account and a Boolean value
    public class wrapSubscription {
        public csord__Subscription__c sub {get; set;}
        public Boolean selected {get; set;}
 
        public wrapSubscription(csord__Subscription__c s) {
            sub = s;
            selected = false;
        }
    }
}
<apex:page docType="html-5.0" controller="HarjeetWrapper" sidebar="false" showHeader="false">



    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
    <apex:form >
        <apex:pageBlock >
        <apex:pageBlockSection >
        <apex:pageBlockSectionItem >
        <!-- <apex:outputText value="{!selectedActions}" label="You have selected:"/>-->
        <!--<apex:outputText label="Select the Action:"/>-->
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1">
                <apex:selectOption itemValue="Take Over" itemLabel="Take Over"/>
                <apex:selectOption itemValue="Invoice Switch" itemLabel="Invoice Switch"/>
                <apex:selectOption itemValue="Move" itemLabel="Move"/>
            </apex:selectList>
            <!--</apex:outputPanel>-->
            </apex:pageBlockSectionItem>
           </apex:pageBlockSection> 
           <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                Date: <apex:input type="date" value="{!dat}" required="true" />
             </apex:pageBlockSectionItem>
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>
    </apex:pageBlock>
 
    
        <apex:pageBlock title="Select Subscription"  >
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Proceed " action="{!processSelected}" />
                <apex:commandButton value="Cancel" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
       <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
             <apex:pageBlockTable value="{!wrapSubscriptionList}" var="subWrap">
                    <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')" />
                        </apex:facet>
                        <!--<apex:inputCheckbox value="{!subWrap.selected}" id="inputId"/>-->
                                <apex:inputCheckbox value="{!subWrap.selected}" id="inputId" disabled="{!NOT(subWrap.sub.csord__Status__c=='Active')}" />
                    </apex:column>
                    
                    <!--<apex:column value="{!subWrap.sub.Name}" />-->
                    <apex:column headerValue="Subscription Name" > 
                        <!--<apex:commandLink value="{!subWrap.sub.Name}" action="/{!subWrap.sub.Id}"/>-->
                       <apex:outputLink value="/{!subWrap.sub.Id}" target="_blank"> {!subWrap.sub.Name} </apex:outputLink>
                   </apex:column>
                     <apex:column value="{!subWrap.sub.csord__Status__c}" />
                    <apex:column value="{!subWrap.sub.csord__Account__c}" />
                </apex:pageBlockTable>
                </apex:pageblockSection>
             <apex:commandButton rendered="{!setCon.hasPrevious}" value="first" action="{!setCon.first}"/>
            <apex:commandButton rendered="{!setCon.hasPrevious}" value="Previous" action="{!setCon.previous}"/>
            <apex:outputLabel value=" (page {!pageNumber} of {!totalPages})"/>
            <apex:outputText rendered="{!(setCon.pageNumber * setCon.pageSize) < setCon.ResultSize}" value="{!setCon.pageNumber * setCon.pageSize} Of {!setCon.ResultSize}"></apex:outputText>
            <apex:outputText rendered="{!(setCon.pageNumber * setCon.pageSize) >= setCon.ResultSize}" value="{!setCon.ResultSize} Of {!setCon.ResultSize}"></apex:outputText>
            <apex:commandButton rendered="{!setCon.hasNext}" value="next" action="{!setCon.next}"/>
            <apex:commandButton rendered="{!setCon.hasNext}" value="last" action="{!setCon.last}"/>

     <apex:pageBlock />
                
                
                <apex:pageblockSection title="Selected Subscriptions" collapsible="false" columns="1" >
                   <apex:pageBlockTable value="{!selectedSubscriptions}" var="c" id="table2" title="Selected Subscriptions" width="100%">
                    <!--<apex:column value="{!c.Name}" headerValue="Subscription Name"/>-->
                    <apex:column headerValue="Subscription Name" > 
                        <apex:commandLink value="{!c.Name}" action="/{!c.Id}" target="_blank"/> 
                      </apex:column> 
                    <apex:column value="{!c.csord__Status__c}" headerValue="Status"/>
                    <apex:column value="{!c.csord__Account__c}" headerValue="Account"/>
                </apex:pageBlockTable>
            

            </apex:pageblockSection>
        </apex:pageBlock>
    </apex:form>
 
</apex:page>
screen shot
Please help me out in this situation,i really need to solve this as soon as possible.
Many thanks in advance.
Note:Pls dont suggest/refer a link to me for this as i have gone through so many links but no luck.So pls look into my code which i have posted here and modify that accordingly.I am seeking help from last 4 days in this forum.



 
Hi All,
I have a requiremnt that an user cant select a date of past in date picker list in visual force page and if he selects/enters a date of past an error msg should be displayed.
Note:This date field on Vf page is a dummy field and is not present on object level.
I am attaching my Vf code and controller along with my screen shot.
public class HarjeetWrapper{
             private Set<Id> selectedContactIds;
             public String selectedActions{get;set;}
             public Date dat {get;set;}
              

            


            public ApexPages.StandardSetController setCon {
            get {
                if(setCon == null) {
                    setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                      [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]));
                             }
                            setCon.setPageSize(20);
                        return setCon;
                }
        set;
    }
    public List<csord__Subscription__c > getWrapSubscriptionList() {
         
         // setCon.setpagesize(20);
         setCon.setpageNumber(1);
         return (List<csord__Subscription__c >) setCon.getRecords();
    }
    public Integer getPageNumber(){
 
        return this.setCon.getPageNumber();
 
    }
    

 


   Public Integer getTotalPages(){
 
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
 
        Decimal pages = totalSize/pageSize;
 
        return (Integer)pages.round(System.RoundingMode.CEILING);
     }
 

    //Our collection of the class/wrapper objects wrapAccount
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;}
    public Boolean isCancel{get;set;}
    public string accountid;
    
    
    public HarjeetWrapper(){
      accountid=ApexPages.currentPage().getParameters().get('id');
        if(wrapSubscriptionList == null) {
           wrapSubscriptionList= new List<wrapSubscription>();
            for(csord__Subscription__c s: [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapSubscriptionList.add(new wrapSubscription(s));
            }
        }
    }
    
    
    public void processSelected() {
    selectedSubscriptions = new List<csord__Subscription__c>();
 
        for(wrapSubscription wrapSubscriptionObj : wrapSubscriptionList) {
            if(wrapSubscriptionObj.selected == true) {
                selectedSubscriptions.add(wrapSubscriptionObj.sub);
            }
        }
    }
    
    public PageReference cancel(){
        return new PageReference('/'+accountid);
    }
    
    public void next(){

    if(this.setCon.getHasNext())
        this.setCon.next();

}

 public void previous(){

    if(this.setCon.getHasPrevious())
        this.setCon.previous();

}
        public List<SelectOption> getCountriesOptions() {
        List<SelectOption> countryOptions = new List<SelectOption>();
        countryOptions.add(new SelectOption('','-None-'));
        countryOptions.add(new SelectOption('Take Over','Take Over'));
        countryOptions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        countryOptions.add(new SelectOption('Move','Move'));
        /*countryOptions.add(new SelectOption('Germany','Germany'));
        countryOptions.add(new SelectOption('Ireland','Ireland'));*/
 
        return countryOptions;
}




                         
 
    // This is our wrapper/container class. In this example a wrapper class contains both the standard salesforce object Account and a Boolean value
    public class wrapSubscription {
        public csord__Subscription__c sub {get; set;}
        public Boolean selected {get; set;}
 
        public wrapSubscription(csord__Subscription__c s) {
            sub = s;
            selected = false;
        }
    }
}
<apex:page docType="html-5.0" controller="HarjeetWrapper" sidebar="false" showHeader="false">



    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
    <apex:form >
        <apex:pageBlock >
        <apex:pageBlockSection >
        <apex:pageBlockSectionItem >
        <!-- <apex:outputText value="{!selectedActions}" label="You have selected:"/>-->
        <!--<apex:outputText label="Select the Action:"/>-->
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1">
                <apex:selectOption itemValue="Take Over" itemLabel="Take Over"/>
                <apex:selectOption itemValue="Invoice Switch" itemLabel="Invoice Switch"/>
                <apex:selectOption itemValue="Move" itemLabel="Move"/>
            </apex:selectList>
            <!--</apex:outputPanel>-->
            </apex:pageBlockSectionItem>
           </apex:pageBlockSection> 
           <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                Date: <apex:input type="date" value="{!dat}" required="true" />
             </apex:pageBlockSectionItem>
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>
    </apex:pageBlock>
 
    
        <apex:pageBlock title="Select Subscription"  >
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Proceed " action="{!processSelected}" />
                <apex:commandButton value="Cancel" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
       <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
             <apex:pageBlockTable value="{!wrapSubscriptionList}" var="subWrap">
                    <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')" />
                        </apex:facet>
                        <!--<apex:inputCheckbox value="{!subWrap.selected}" id="inputId"/>-->
                                <apex:inputCheckbox value="{!subWrap.selected}" id="inputId" disabled="{!NOT(subWrap.sub.csord__Status__c=='Active')}" />
                    </apex:column>
                    
                    <!--<apex:column value="{!subWrap.sub.Name}" />-->
                    <apex:column headerValue="Subscription Name" > 
                        <!--<apex:commandLink value="{!subWrap.sub.Name}" action="/{!subWrap.sub.Id}"/>-->
                       <apex:outputLink value="/{!subWrap.sub.Id}" target="_blank"> {!subWrap.sub.Name} </apex:outputLink>
                   </apex:column>
                     <apex:column value="{!subWrap.sub.csord__Status__c}" />
                    <apex:column value="{!subWrap.sub.csord__Account__c}" />
                </apex:pageBlockTable>
                </apex:pageblockSection>
             <apex:commandButton rendered="{!setCon.hasPrevious}" value="first" action="{!setCon.first}"/>
            <apex:commandButton rendered="{!setCon.hasPrevious}" value="Previous" action="{!setCon.previous}"/>
            <apex:outputLabel value=" (page {!pageNumber} of {!totalPages})"/>
            <apex:outputText rendered="{!(setCon.pageNumber * setCon.pageSize) < setCon.ResultSize}" value="{!setCon.pageNumber * setCon.pageSize} Of {!setCon.ResultSize}"></apex:outputText>
            <apex:outputText rendered="{!(setCon.pageNumber * setCon.pageSize) >= setCon.ResultSize}" value="{!setCon.ResultSize} Of {!setCon.ResultSize}"></apex:outputText>
            <apex:commandButton rendered="{!setCon.hasNext}" value="next" action="{!setCon.next}"/>
            <apex:commandButton rendered="{!setCon.hasNext}" value="last" action="{!setCon.last}"/>

     <apex:pageBlock />
                
                
                <apex:pageblockSection title="Selected Subscriptions" collapsible="false" columns="1" >
                   <apex:pageBlockTable value="{!selectedSubscriptions}" var="c" id="table2" title="Selected Subscriptions" width="100%">
                    <!--<apex:column value="{!c.Name}" headerValue="Subscription Name"/>-->
                    <apex:column headerValue="Subscription Name" > 
                        <apex:commandLink value="{!c.Name}" action="/{!c.Id}" target="_blank"/> 
                      </apex:column> 
                    <apex:column value="{!c.csord__Status__c}" headerValue="Status"/>
                    <apex:column value="{!c.csord__Account__c}" headerValue="Account"/>
                </apex:pageBlockTable>
            

            </apex:pageblockSection>
        </apex:pageBlock>
    </apex:form>
 
</apex:page>
screen shot
Please help me out in this situation,i really need to solve this as soon as possible.
Many thanks in advance.
Note:Pls dont suggest/refer a link to me for this as i have gone through so many links but no luck.So pls look into my code which i have posted here and modify that accordingly.I am seeking help from last 4 days in this forum.




 
Hi All,

I am working on a test class for a class which was created by me nut unfortunately i am not able to increase the code coverage beyond 67%.
P.F.A the controller and test class.
public with sharing class TfB_PB_AccountActionsWrapper{
       
    public List<wrapSubscription> SubscriptionSetList{get;set;}
    public integer size{get;set;}
    public Date currentDateValue { get; set; }
    public String selectedActions{get;set;}
    public csord__Subscription__c vSub{get;set;}
    public List<csord__Subscription__c> vLstSub{get;set;}
    public Map<Id, List<csord__Subscription__c>> AccIdSubListMap { get; set; }
    public Opportunity oppList;
    public Map<Id, List<csord__Service__c>> SubIdServListMap { get; set; }
    Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public boolean AccountBool{get;set;}
    public boolean fals{get;set;}
    public Date SysDate{get;set;}
    public Account vAccount{get;set;}
    public Account vSourceAccount{get;set;}
    public String contextItem{get;set;}
    public integer noOfRecords{get;set;}
    public set<csord__Subscription__c > selectedSubscription;
    public List<csord__Subscription__c > selectedSubscriptionList;
    public set<id> subids;
    public Id OpptyId;
    public string accountId;
    public String baseQuery;
    
    //Constructor for the class    
    public TfB_PB_AccountActionsWrapper( ){
       
        AccIdSubListMap=new Map<Id, List<csord__Subscription__c>>();
        SubIdServListMap= new Map<Id, List<csord__Service__c>>();
        
        vSub= new csord__Subscription__c();
        selectedActions='Takeover';
        if(selectedActions=='Takeover'){
            AccountBool=true; 
        }
        fals= false; 
        this.subids = new set<id>();
        selectedSubscriptionList = new List<csord__Subscription__c >(); 
        this.selectedSubscription = new set<csord__Subscription__c>();
        SubscriptionSetList = new List<wrapSubscription>();
        accountId=ApexPages.currentPage().getParameters().get('id');      
    }
    
    //Following property will pick values from the custom setting
        public List<selectOption> ActionValues {
        get {
          List<selectOption> options = new List<selectOption>();
    
          for (TfB_PB_ChangeType__c cType : TfB_PB_ChangeType__c.getAll().values())
          
            options.add(new SelectOption(cType.Name,cType.Name));
          return options;
        }
        set;
      }
    
    //This function implements the pagination logic
    public ApexPages.StandardSetController SubSetController{ 
        
        get{            
            if(SubSetController == null){
                size =20;                
                SubSetController = new ApexPages.StandardSetController([SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,Billing_Account_Number__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId order by Billing_Account_Number__c desc nulls Last]);
                system.debug('Return Records $$$$$$$$'+SubSetController);            
                this.SubSetController.setpageNumber(1);               
                this.SubSetController.setPageSize(size);
                noOfRecords = SubSetController.getResultSize(); 
            }
            return SubSetController;
          }set;
     }
     
     //Below logic is used for enable/disable of Target Account field based on Action field value
    public void getDisplayAccount( ){
       if(selectedActions!='Takeover'){
            AccountBool=false; 
        }
        else{
            AccountBool=true;
        }
    }
    
    //Following function implements wrapper logic 
    public List<wrapSubscription> getCurrentList( ){        
        updateSelectedSubscriptions();
        SubscriptionSetList = new List<wrapSubscription>();
        for (csord__Subscription__c vSubscription : (List<csord__Subscription__c >)SubSetController.getRecords( )){
            system.debug('vSubscription @@@@@@@@@ '+vSubscription);
            if(selectedSubscription.contains(vSubscription))
                SubscriptionSetList.add(new wrapSubscription(vSubscription,'true'));
            else
                SubscriptionSetList.add(new wrapSubscription(vSubscription));
                system.debug('SubscriptionSetList########'+SubscriptionSetList);
        }  
        fals=false;       
        return SubscriptionSetList;
    }
    
   //This method update the selected Subscriptions List in the wrapper Class
    public void updateSelectedSubscriptions( ){
        for(wrapSubscription cs: SubscriptionSetList){
            if(cs.selected){              
                selectedSubscription.add(cs.vSub);
                selectedSubscriptionList.addAll(selectedSubscription);
                system.debug('++++++++'+selectedSubscriptionList.size());
              }
            else{            
                if(selectedSubscription.contains(cs.vSub))
                selectedSubscription.remove(cs.vSub);                              
            }
            
        }
    }
    
    //This method adding the selected subscriptions to the list
    public void doSelectItem( ){        
        if(contextItem!=null)
            this.subids.add(this.contextItem);        
    }
    
    //This method remove the deselected subscriptions to the list
    public void doDeselectItem( ){      
        this.subids.remove(this.contextItem);        
    }
     
    //This method count the selected subscriptions
    public Integer getSelectedCount( ){       
       // subids.clear();
        for(csord__Subscription__c acc: selectedSubscription){
            subids.add(acc.id);
        }
        return this.subids.size();       
    }
     
    //Below method implements the Next button logic for pagination
    public void doNext( ){       
        if(this.SubSetController.getHasNext())
            this.SubSetController.next();       
    }
    
    
    //Below method for the Previous button logic for pagination
     public void doPrevious( ){       
        if(this.SubSetController.getHasPrevious())
            this.SubSetController.previous();        
    }
     
    public Boolean getHasPrevious( ){       
        return this.SubSetController.getHasPrevious();        
    }
       
       
    //Below method implements the Next button logic for pagination   
    public Boolean getHasNext( ){      
        return this.SubSetController.getHasNext();        
    }
       
       
    //Following method returns the current page number in pagination logic  
    public Integer getPageNumber( ){       
        return this.SubSetController.getPageNumber();        
    }
       
       
    //Following function implements the total pages number  
    public Integer getTotalPages( ){       
        Decimal totalSize = this.SubSetController.getResultSize();
        Decimal pageSize = this.SubSetController.getPageSize();       
        Decimal pages = totalSize/pageSize;       
        return (Integer)pages.round(System.RoundingMode.CEILING);
    } 
       
    //Below method has logic for Cancel button used in pagination       
    public PageReference cancel( ){
        return new PageReference('/'+accountid);
    }       
      
      
    //Following function will perform the validations behind the Continue button& restrict an user to proceed to next page if any of the validation fails.Also invokes the method provided by CS Team.
    public pageReference Proceed( ){
        SysDate = System.today();
        accountId=ApexPages.currentPage().getParameters().get('id');
        if(vSub.csord__Account__c!= null){
            vAccount=[Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:vSub.csord__Account__c];  
        }  
        
        vSourceAccount = [Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:accountId];
        if(selectedActions =='Takeover'){
            if(vSub.csord__Account__c==null){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please select The Target Account');
                ApexPages.addMessage(myMsg);            
                return null;          
            }                      
            if(vSub.csord__Account__c==accountId){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The target account is the same as the current account, it has to be different.');
                ApexPages.addMessage(myMsg);            
                return null; 
            } 
            
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c== null){                                                                     
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){                                                              
                system.debug('Negative Else1----');                                      
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            } 
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Positive' || vAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                        
                system.debug('========='+subids);
                if(subids.size()>0){
                try
                {
                    system.debug('@@@@@@@@@@ :'+selectedSubscriptionList.size());
                    system.debug('###########:'+vAccount.Id);
                    system.debug('***********:'+selectedActions);
                    system.debug('%%%%%%%%%%%:'+currentDateValue);
                    OpptyId = TB_PB_CloneOpportunity.createClonedOpportunity(selectedSubscriptionList,vAccount.Id,selectedActions,currentDateValue);
                    system.debug('Opportunity Id is :'+OpptyId);
                    PageReference pageOpportunity = new PageReference('/'+OpptyId);
                    system.debug('pageOpportunity is :'+pageOpportunity );
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                 }
                 catch(Exception e)
                 {
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'There was a technical problem encountered while carrying out this order. To retry click on Continue button again, if you still get this message please take a screen print and log a ticket in Remedy force');
                    ApexPages.addMessage(myMsg);                  
                 }
                  return null;  
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                    }   
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){                                                                          
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                system.debug('Negative----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == null || vAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                system.debug('Negative Else----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            }                                  
            return null;                              
        }                                                                                
        else if(selectedActions =='Move'){
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c== null){                            
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            }  
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Positive'|| vSourceAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                      
                system.debug('========='+subids);
                if(subids.size()>0){
                try
                {
                    system.debug('@@@@@@@@@@ :'+selectedSubscriptionList.size());
                    system.debug('###########:'+null);
                    system.debug('***********:'+selectedActions);
                    system.debug('%%%%%%%%%%%:'+currentDateValue);
                    OpptyId = TB_PB_CloneOpportunity.createClonedOpportunity(selectedSubscriptionList,null,selectedActions,currentDateValue);
                    system.debug('Opportunity Id is :'+OpptyId);
                    PageReference pageOpportunity = new PageReference('/'+OpptyId);
                    system.debug('pageOpportunity is :'+pageOpportunity );
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                 }
                 catch(Exception e)
                 {
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'There was a technical problem encountered while carrying out this order. To retry click on Continue button again, if you still get this message please take a screen print and log a ticket in Remedy force');
                    ApexPages.addMessage(myMsg);                  
                 }
                 return null;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }   
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == null || vSourceAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            } 
            return null; 
        }                                                                                                                                                                                                                                
            else{
                system.debug('========='+subids);
                if(subids.size()>0){
               try
                {
                    system.debug('@@@@@@@@@@ :'+selectedSubscriptionList.size());
                    system.debug('###########:'+null);
                    system.debug('***********:'+selectedActions);
                    system.debug('%%%%%%%%%%%:'+currentDateValue);
                    OpptyId = TB_PB_CloneOpportunity.createClonedOpportunity(selectedSubscriptionList,null,selectedActions,currentDateValue);
                    system.debug('Opportunity Id is :'+OpptyId);
                    PageReference pageOpportunity = new PageReference('/'+OpptyId);
                    system.debug('pageOpportunity is :'+pageOpportunity );
                    pageOpportunity.setRedirect(false);
                    return pageOpportunity;
                 }
                 catch(Exception e)
                 {
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'There was a technical problem encountered while carrying out this order. To retry click on Continue button again, if you still get this message please take a screen print and log a ticket in Remedy force');
                    ApexPages.addMessage(myMsg);                  
                 }
                 return null;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }        
                 
            } 
    }        
    
    //Wrapper class logic      
    public class wrapSubscription{
        public csord__Subscription__c vSub {get; set;}        
        public Boolean selected {get; set;}
        public wrapSubscription( ){
            vSub = new csord__Subscription__c();
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c a){
            vSub = a;
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c c,string s){
            vSub=c;
            selected=true;
        }       
        
    }
}





Following lines of code is not getting covered after so much permutations and combinations.
All these lines are called behind "Proceed" button.


This forum helped me earlier many times and this time again i am very hopeful and can expect that i would be able to make it beyond 75%.Many thanks in advance..

 
Hi All,
P.F.A my controller class and test class.I am unable to increase my code coverage after 60%.
public with sharing class AccountActionsWrapper{
       
    public List<wrapSubscription> SubscriptionSetList{get;set;}
    public integer size{get;set;}
    public String currentDateValue { get; set; }
    public String selectedActions{get;set;}
    public csord__Subscription__c vSub{get;set;}
    public List<csord__Subscription__c> vLstSub{get;set;}
    public Map<Id, List<csord__Subscription__c>> AccIdSubListMap { get; set; }
   
    public Map<Id, List<csord__Service__c>> SubIdServListMap { get; set; }
    Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    //public List<csord__Service__c> vLstServ{get;set;}
    public boolean AccountBool{get;set;}
    public boolean fals{get;set;}
    public Date SysDate{get;set;}
    public Account vAccount{get;set;}
    public Account vSourceAccount{get;set;}
    public String contextItem{get;set;}
    public integer noOfRecords{get;set;}
    public set<csord__Subscription__c > selectedSubscription;
    public set<id> subids;
    public string accountId;
    public String baseQuery;
    
    //Constructor for the class    
    public AccountActionsWrapper( ){
       
        AccIdSubListMap=new Map<Id, List<csord__Subscription__c>>();
        SubIdServListMap= new Map<Id, List<csord__Service__c>>();
        vSub= new csord__Subscription__c();
        selectedActions='Take Over';
        if(selectedActions=='Take Over'){
            AccountBool=true; 
        }
        fals= false; 
        this.subids = new set<id>();
        this.selectedSubscription = new set<csord__Subscription__c>();
        SubscriptionSetList = new List<wrapSubscription>();
        accountId=ApexPages.currentPage().getParameters().get('id');
        //baseQuery = 'SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId';
        //system.debug('Records &&&&&&'+baseQuery);
    }
        public List<selectOption> ActionValues {
        get {
          List<selectOption> options = new List<selectOption>();
    
          for (csordtelcoa__Change_Types__c cType : csordtelcoa__Change_Types__c.getAll().values())
            options.add(new SelectOption(cType.Name,cType.Name));
          return options;
        }
        set;
      }
    
    //This function implements the pagination logic
    public ApexPages.StandardSetController SubSetController{ 
        
        get{            
            if(SubSetController == null){
                size =20;
                //SubSetController = new ApexPages.StandardSetController(Database.getQueryLocator(baseQuery));
                SubSetController = new ApexPages.StandardSetController([SELECT Name, csord__Status__c,csord__Account__c,MACD_in_progress__c,Billing_Account_Number__c,(select Id,Billing_Account_Number__c from csord__Services__r) FROM csord__Subscription__c where csord__Account__c=:accountId order by Billing_Account_Number__c desc nulls Last]);
                system.debug('Return Records $$$$$$$$'+SubSetController);            
                this.SubSetController.setpageNumber(1);               
                this.SubSetController.setPageSize(size);
                noOfRecords = SubSetController.getResultSize(); 
            }
            return SubSetController;
          }set;
     }
     
     //The following function is used for retrieving different picklist value from Action field
    public List<SelectOption> getActions( ){ 
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
     }
     
     
     //Below logic is used for enable/disable of Target Account field based on Action field value
    public void getDisplayAccount( ){
        if(selectedActions!='Take Over'){
            AccountBool=false; 
        }
        else{
            AccountBool=true;
        }
    }
    
    //Following function implements wrapper logic 
    public List<wrapSubscription> getCurrentList( ){        
        updateSelectedSubscriptions();
        SubscriptionSetList = new List<wrapSubscription>();
        for (csord__Subscription__c vSubscription : (List<csord__Subscription__c >)SubSetController.getRecords( )){
            system.debug('vSubscription @@@@@@@@@ '+vSubscription);
            if(selectedSubscription.contains(vSubscription))
                SubscriptionSetList.add(new wrapSubscription(vSubscription,'true'));
            else
                SubscriptionSetList.add(new wrapSubscription(vSubscription));
                system.debug('SubscriptionSetList########'+SubscriptionSetList);
        }  
        fals=false;       
        return SubscriptionSetList;
    }
    
   //This method update the selected Subscriptions List in the wrapper Class
    public void updateSelectedSubscriptions( ){
        for(wrapSubscription cs: SubscriptionSetList){
            if(cs.selected)
                selectedSubscription.add(cs.vSub);
            else
            {
                if(selectedSubscription.contains(cs.vSub))
                selectedSubscription.remove(cs.vSub);
                
            }
            
        }
    }
    
    //This method adding the selected subscriptions to the list
    public void doSelectItem( ){        
        if(contextItem!=null)
            this.subids.add(this.contextItem);        
    }
    
    //This method remove the deselected subscriptions to the list
    public void doDeselectItem( ){      
        this.subids.remove(this.contextItem);        
    }
     
    //This method count the selected subscriptions
    public Integer getSelectedCount( ){       
        subids.clear();
        for(csord__Subscription__c acc: selectedSubscription){
            subids.add(acc.id);
        }
        return this.subids.size();       
    }
     
    //Below method implements the Next button logic for pagination
    public void doNext( ){       
        if(this.SubSetController.getHasNext())
            this.SubSetController.next();       
    }
    
    
    //Below method for the Previous button logic for pagination
     public void doPrevious( ){       
        if(this.SubSetController.getHasPrevious())
            this.SubSetController.previous();        
    }
     
    public Boolean getHasPrevious( ){       
        return this.SubSetController.getHasPrevious();        
    }
       
       
    //Below method implements the Next button logic for pagination   
    public Boolean getHasNext( ){      
        return this.SubSetController.getHasNext();        
    }
       
       
    //Following method returns the current page number in pagination logic  
    public Integer getPageNumber( ){       
        return this.SubSetController.getPageNumber();        
    }
       
       
    //Following function implements the total pages number  
    public Integer getTotalPages( ){       
        Decimal totalSize = this.SubSetController.getResultSize();
        Decimal pageSize = this.SubSetController.getPageSize();       
        Decimal pages = totalSize/pageSize;       
        return (Integer)pages.round(System.RoundingMode.CEILING);
    } 
       
    //Below method has logic for Cancel button used in pagination       
    public PageReference cancel( ){
        return new PageReference('/'+accountid);
    }       
      
      
    //Following function will perform the validations behind the Continue button& restrict an user to proceed to next page if any of the validation fails.Also invokes the method provided by CS Team.
    public pageReference Proceed( ){
        SysDate = System.today();
        accountId=ApexPages.currentPage().getParameters().get('id');
        if(vSub.csord__Account__c!= null){
            vAccount=[Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:vSub.csord__Account__c];  
        }   
             //Venkat added the below logic
        vSourceAccount = [Select Name,TINA_Parent_Cust_Number__c,TfB_PB_CreditCheckExpiryDate__c,TfB_PB_CreditCheckResponse__c from Account where Id=:accountId];
        if(selectedActions =='Take Over'){
            if(vSub.csord__Account__c==null){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Please select The Target Account');
                ApexPages.addMessage(myMsg);            
                return null;          
            }  
                   
                    
            if(vSub.csord__Account__c==accountId){ 
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The target account is the same as the current account, it has to be different.');
                ApexPages.addMessage(myMsg);            
                return null; 
            }
                       
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c== null){                                                                     
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
                                  
            if(vAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){                                                              
                system.debug('Negative Else1----');                                      
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            } 
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Positive' || vAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                        
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                    }   
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){                                                                          
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                system.debug('Negative----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            
            if(vAccount.TfB_PB_CreditCheckResponse__c == null || vAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                system.debug('Negative Else----');
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            }                                  
            return null;                              
        }                                                                                
        else if(selectedActions =='Move'){
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c== null){                            
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The credit check for this account is missing an expiry date, you need to do another credit check before entering the Takeover order.');
                ApexPages.addMessage(myMsg);            
                return null;                                 
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckExpiryDate__c <= SysDate){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The Credit Check results have reached the expiry date. Please perform the Credit Check from the account before performing Order');
                ApexPages.addMessage(myMsg);            
                return null;                       
            }  
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Positive'|| vSourceAccount.TfB_PB_CreditCheckResponse__c == 'ERROR'){                      
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }   
            }
            
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-1'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -1');
                ApexPages.addMessage(myMsg);            
                return null;
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == 'Negative-2'){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You cannot proceed with Order Intake since the customer has a negative credit check -2');
                ApexPages.addMessage(myMsg);            
                return null;                             
            }
            if(vSourceAccount.TfB_PB_CreditCheckResponse__c == null || vSourceAccount.TfB_PB_CreditCheckResponse__c!='POSITIVE' ||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-1'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='NEGATIVE-2'||vSourceAccount.TfB_PB_CreditCheckResponse__c!='ERROR' ){
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'The account does not have a positive credit check, you need to get an approval to continue with the order');
                ApexPages.addMessage(myMsg);            
                return null;                                           
            } 
            return null; 
        }                                                                                                                                                                                                                                
            else{
                if(subids.size()>0){
                    pageReference pr = new PageReference('/apex/StatusPage');
                    return pr;
                }
                else{
                    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'You need to select atleast one subscription');
                    ApexPages.addMessage(myMsg);            
                    return null; 
                }        
                 
            } 
    }        
    
    //Wrapper class logic      
    public class wrapSubscription{
        public csord__Subscription__c vSub {get; set;}        
        public Boolean selected {get; set;}
        //public List<csord__Service__c> vServ{get;set;}
        //public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription( ){
            vSub = new csord__Subscription__c();
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c a){
            vSub = a;
            selected = false;
        }
        public wrapSubscription(csord__Subscription__c c,string s){
            vSub=c;
            selected=true;
        }       
        
    }
}
@isTest(seeAlldata=true)
public class TfB_PB_TestAccountActionsWrapper
{
    public static testMethod void myUnitTest() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6548681',TfB_PB_CreditCheckResponse__c='Positive');
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'test');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
        objActWap.getActions();
        objActWap.getDisplayAccount();
        objActWap.getCurrentList();
        objActWap.updateSelectedSubscriptions();
        objActWap.doSelectItem();
        objActWap.doDeselectItem();
        objActWap.getSelectedCount();
        objActWap.doNext();
        objActWap.doPrevious();
        objActWap.getHasPrevious();
        objActWap.getHasNext();
        objActWap.cancel();
        objActWap.getTotalPages();
        objActWap.getPageNumber();
        
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest1() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test1',C_fe_Customer_Number__c='6590681',TfB_PB_CreditCheckExpiryDate__c=system.today()-1);
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'test');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    public static testMethod void myUnitTest2() 
    { 
        PageReference pg = Page.TfB_PB_AccountActionsVf;
        Test.setCurrentPage(pg); 
        Account SourceAcc = new Account(Name='Test2',C_fe_Customer_Number__c='738745936',TfB_PB_CreditCheckResponse__c='Negative-1');
        insert SourceAcc;   
        csord__Order_Request__c vOrderReq = new csord__Order_Request__c();
        vOrderReq.Name='Test Order';
        vOrderReq.csord__Module_Name__c='TestModule';
        vOrderReq.csord__Module_Version__c='TestVersion';
        vOrderReq.TfB_PB_Account__c=SourceAcc.Id;
        insert vOrderReq;
    
        csord__Subscription__c  objCS = new csord__Subscription__c (csord__Account__c = SourceAcc.Id,csord__Order_Request__c=vOrderReq.Id,csord__Identification__c='abc',Name= 'test');
        insert objCS;
    
        TfB_PB_AccountActionsWrapper objActWap = new TfB_PB_AccountActionsWrapper();
        ApexPages.currentPage().getParameters().put('id',SourceAcc.Id);
        objActWap.selectedActions='Move';
        objActWap.Proceed();
               
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper = new TfB_PB_AccountActionsWrapper.wrapSubscription(); 
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper1 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS);
         TfB_PB_AccountActionsWrapper.wrapSubscription AccWrapper2 = new TfB_PB_AccountActionsWrapper.wrapSubscription(objCS,'True');
    }
    
    
}
Whenver i am covering one if case lets say Suppose i am covering if condition for "Positive" for Take Over scenario(refer above code),then Negative-1 or Negative-2 code become uncovered and vice cersa.I am not able to increase after 605 after so many try.
Ply help me on this.

Mnay thanks in advance.

 
Hi All,
I have a requiremnt which i am describing below:
There is a button called "Continue" on UI. When an user clicks on it it will redirect to some other page. But prior to that one validations need to be done. As you people can see in the screen shot which i attached here is there is checkbox along with the name of each subscription. So my requirement is if an user does not select any single subscription with "Active" status and if user clicks on proceed button an error message must be thrown "Please select al least one active subscription".
I am attaching the corresponding code and Visual force page with the screen shot.
public with sharing class AccountActionsWrapper
{       
    public String contextItem{get;set;}   
    public set<Id> selectedContactIds{get;set;}
    public String accountName {get; set;}
    public string accountid;
    public String selectedActions{get;set;}
    public boolean AccountBool{get;set;}
    public List<Account> accounts {get; set;}
    public List<csord__Service__c> vLstServ{ get; set; }
    public Id acctId {get; set;}
    public integer size{get;set;}
    public Map<Id, List<csord__Service__c>> memIdServListMap { get; set; }
    public integer noOfRecords{get;set;}
    public Date dat {get;set;}
    Set<Id> SubIds = new Set<Id>();
    public boolean Display{get;set;}
     Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public List<csord__Subscription__c>vLstSubscriptions{get;set;}
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;} 
    public Boolean isCancel{get;set;}
    public String query {get; set;}
    public String dateError {get;set;}
    public String currentDateValue { get; set; }

    public ApexPages.StandardSetController setCon {
        get{
            if(setCon == null){
           size =20; 
           accountid=ApexPages.currentPage().getParameters().get('id');
           selectedContactIds= new Set<Id>();       
           setCon= new ApexPages.StandardSetController( [select Id, Name,csord__Status__c,MACD_in_progress__c , csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid] );
           this.setCon.setpageNumber(1);
           setCon.setPageSize(size);
           noOfRecords = setCon.getResultSize();            
            }
            return setCon;
        }set;
    }
    
     public AccountActionsWrapper() 
     {
       selectedActions='Take Over';
       if(selectedActions=='Take Over')
       {
          AccountBool=true; 
       } 
      }
        
    public List<SelectOption> getActions() {
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
    }
    public void getDisplayAccount()
    {
        if(selectedActions!='Take Over')
        {
           AccountBool=false; 
        }
        else
        {
             AccountBool=true;
        }
    }
    
    //function to get date value    
     public void getValue(){
      System.debug('*************'+currentDateValue);
      
    
     }
     
     //Function to retrieving account detail in pop-up upon clicking on Lookup in VF page
     public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }   
    
    public void doSelectItem()
    {
      this.selectedContactIds.add(this.contextItem);
    } 
    public void doDeselectItem()
    {
      this.selectedContactIds.remove(this.contextItem);
    } 
    public Integer getSelectedCount()
    {
      return this.selectedContactIds.size();
    }
    public void doNext()
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
    } 
    public void doPrevious()
    {
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doStart() 
    { 
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doEnd() 
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
   }
     
    public List<wrapSubscription> getSubscriptions()
    { 
        
        List<wrapSubscription> rows = new List<wrapSubscription>(); 
        //vLstSubscriptions = [select Id, Name,csord__Status__c, csord__Account__c,(select Id,Billing_Account_Number__c from csord__Services__r) from csord__Subscription__c where csord__Account__c=:accountid limit 100];
        for(sObject r : this.setCon.getRecords())
        {
            csord__Subscription__c c = (csord__Subscription__c)r;
            wrapSubscription row = new wrapSubscription(c,vLstServ);
            if(this.selectedContactIds.contains(c.Id))
            {
                row.selected=true;
            }
            else
            {
                row.selected=false;
            }
            rows.add(row);
        }
        return rows;
         
    }
    public PageReference cancel()
    {
        return new PageReference('/'+accountid);
    }
    public Boolean getHasPrevious()
    { 
        return this.setCon.getHasPrevious();
    } 
    public Boolean getHasNext()
    {
       return this.setCon.getHasNext(); 
    }  
    public Integer getPageNumber()
    {
       return this.setCon.getPageNumber();
    } 
    Public Integer getTotalPages()
    {
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
        Decimal pages = totalSize/pageSize; 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }  
    public class wrapSubscription
    { 
        public csord__Subscription__c sub {get; set;}        
        public Boolean selected {get; set;}
        public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription(csord__Subscription__c c,List<csord__Service__c> vLstServ)
        {
            this.sub=c;
            this.Serv=vLstServ;
            this.selected=false;
        }
 
    }
}
 
<apex:page docType="html-5.0" controller="AccountActionsWrapper" sidebar="false" showHeader="false" id="pg" >

<head>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
</head>


<!--for mm/dd/yyyy format-->
<!--<script>
       $(function(){
        $('.datepicker').datepicker({
             minDate: 0 
         }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>-->

<!--for dd/mm/yyyy format-->
<script>
       $(function(){
        $('.datepicker').datepicker({ minDate: 0 , dateFormat: 'dd/mm/yy' }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>


<script>
    var newWin=null;
    function openLookupPopup(name, id)
    {
        var url="/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
        newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
    }
                  
    function closeLookupPopup()
    {
       if (null!=newWin)
       {
          newWin.close();
       }  
    }
    
  
    
     function doCheckboxChange(cb,itemId){ 
            if(cb.checked==true){
                aSelectItem(itemId);
            }
            else{
                aDeselectItem(itemId);
            }
        }
</script>

    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
   
    <apex:form >
    <apex:pageBlock >    
      <apex:pageBlockSection >    
        <apex:pageBlockSectionItem >
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1" >
                <apex:selectOptions value="{!Actions}"/>
                <apex:actionSupport event="onchange" action="{!getDisplayAccount}" reRender="panel"/>             
            </apex:selectList>
           </apex:pageBlockSectionItem>
           </apex:pageBlockSection>
      <apex:outputPanel >        
       <apex:pageBlockSection >     
           <apex:pageBlockSectionItem >          
           <apex:outputLabel value="Target Account"/>        
           <apex:outputPanel id="panel" >
            <apex:inputHidden value="{!acctId}" id="targetId"/>
            <apex:inputText size="40" value="{!accountName}" id="targetName" onFocus="this.blur()" disabled="{!!AccountBool}"/>&nbsp;
            
            <apex:outputLink rendered="{!AccountBool}" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</apex:outputLink>                    
          </apex:outputPanel>          
      </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      </apex:outputPanel>
               <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                <!--Date: <apex:input type="date" value="{!dat}" required="false"/>--> 
                Effective From:<apex:inputText id="datepicker" styleClass="datepicker"  value="{!currentDateValue}" required="false"/>              
            </apex:pageBlockSectionItem>           
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>       
    </apex:pageBlock>   
        
        <!-- handle selected item -->
        <apex:actionFunction name="aSelectItem" action="{!doSelectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <!-- handle deselected item -->
        <apex:actionFunction name="aDeselectItem" action="{!doDeselectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>        
         <apex:pageBlock title="Select Subscriptions" id="mpb">        
            <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
            <apex:pageBlockTable value="{!Subscriptions}" var="c">
                <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>                       
                            <apex:inputCheckbox value="{!c.selected}" id="inputId" disabled="{!NOT(c.sub.csord__Status__c=='Active') && (c.sub.MACD_in_progress__c=False)}" onchange="doCheckboxChange(this,'{!c.sub.Id}')"/>
                            
                    </apex:column>           
                 <apex:column headerValue="Subscription Name" >                       
                       <apex:outputLink value="/{!c.sub.Id}" target="_blank"> {!c.sub.Name} </apex:outputLink>
                   </apex:column>
                <apex:column value="{!c.sub.csord__Status__c}"/>                
                           
            </apex:pageBlockTable>
            </apex:pageblockSection>
           
        <apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}" title="First Page"/>
        <apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
        <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
        <apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next Page"/>
        <apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last Page"/>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Continue "  />
                <apex:commandButton value="Back" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
        </apex:pageBlock>        
    </apex:form>
</apex:page>

screen shot
This forum has helped me out earlier also and i am very hopeful that you people will help me out this time also.
Please fine tune my code wherever applicable.

Many thanks in advance.
Hi All,
I have a requiremnt which i am describing below:
There is a button called "Continue" on UI. When an user clicks on it it will redirect to some other page. But prior to that one validations need to be done. As you people can see in the screen shot which i attached here is there is checkbox along with the name of each subscription. So my requirement is if an user does not select any single subscription with "Active" status and if user clicks on proceed button an error message must be thrown "Please select al least one active subscription".
I am attaching the corresponding code and Visual force page with the screen shot.
public with sharing class AccountActionsWrapper
{       
    public String contextItem{get;set;}   
    public set<Id> selectedContactIds{get;set;}
    public String accountName {get; set;}
    public string accountid;
    public String selectedActions{get;set;}
    public boolean AccountBool{get;set;}
    public List<Account> accounts {get; set;}
    public List<csord__Service__c> vLstServ{ get; set; }
    public Id acctId {get; set;}
    public integer size{get;set;}
    public Map<Id, List<csord__Service__c>> memIdServListMap { get; set; }
    public integer noOfRecords{get;set;}
    public Date dat {get;set;}
    Set<Id> SubIds = new Set<Id>();
    public boolean Display{get;set;}
     Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public List<csord__Subscription__c>vLstSubscriptions{get;set;}
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;} 
    public Boolean isCancel{get;set;}
    public String query {get; set;}
    public String dateError {get;set;}
    public String currentDateValue { get; set; }

    public ApexPages.StandardSetController setCon {
        get{
            if(setCon == null){
           size =20; 
           accountid=ApexPages.currentPage().getParameters().get('id');
           selectedContactIds= new Set<Id>();       
           setCon= new ApexPages.StandardSetController( [select Id, Name,csord__Status__c,MACD_in_progress__c , csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid] );
           this.setCon.setpageNumber(1);
           setCon.setPageSize(size);
           noOfRecords = setCon.getResultSize();            
            }
            return setCon;
        }set;
    }
    
     public AccountActionsWrapper() 
     {
       selectedActions='Take Over';
       if(selectedActions=='Take Over')
       {
          AccountBool=true; 
       } 
      }
        
    public List<SelectOption> getActions() {
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
    }
    public void getDisplayAccount()
    {
        if(selectedActions!='Take Over')
        {
           AccountBool=false; 
        }
        else
        {
             AccountBool=true;
        }
    }
    
    //function to get date value    
     public void getValue(){
      System.debug('*************'+currentDateValue);
      
    
     }
     
     //Function to retrieving account detail in pop-up upon clicking on Lookup in VF page
     public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }   
    
    public void doSelectItem()
    {
      this.selectedContactIds.add(this.contextItem);
    } 
    public void doDeselectItem()
    {
      this.selectedContactIds.remove(this.contextItem);
    } 
    public Integer getSelectedCount()
    {
      return this.selectedContactIds.size();
    }
    public void doNext()
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
    } 
    public void doPrevious()
    {
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doStart() 
    { 
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doEnd() 
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
   }
     
    public List<wrapSubscription> getSubscriptions()
    { 
        
        List<wrapSubscription> rows = new List<wrapSubscription>(); 
        //vLstSubscriptions = [select Id, Name,csord__Status__c, csord__Account__c,(select Id,Billing_Account_Number__c from csord__Services__r) from csord__Subscription__c where csord__Account__c=:accountid limit 100];
        for(sObject r : this.setCon.getRecords())
        {
            csord__Subscription__c c = (csord__Subscription__c)r;
            wrapSubscription row = new wrapSubscription(c,vLstServ);
            if(this.selectedContactIds.contains(c.Id))
            {
                row.selected=true;
            }
            else
            {
                row.selected=false;
            }
            rows.add(row);
        }
        return rows;
         
    }
    public PageReference cancel()
    {
        return new PageReference('/'+accountid);
    }
    public Boolean getHasPrevious()
    { 
        return this.setCon.getHasPrevious();
    } 
    public Boolean getHasNext()
    {
       return this.setCon.getHasNext(); 
    }  
    public Integer getPageNumber()
    {
       return this.setCon.getPageNumber();
    } 
    Public Integer getTotalPages()
    {
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
        Decimal pages = totalSize/pageSize; 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }  
    public class wrapSubscription
    { 
        public csord__Subscription__c sub {get; set;}        
        public Boolean selected {get; set;}
        public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription(csord__Subscription__c c,List<csord__Service__c> vLstServ)
        {
            this.sub=c;
            this.Serv=vLstServ;
            this.selected=false;
        }
 
    }
}
<apex:page docType="html-5.0" controller="AccountActionsWrapper" sidebar="false" showHeader="false" id="pg" >

<head>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
</head>


<!--for mm/dd/yyyy format-->
<!--<script>
       $(function(){
        $('.datepicker').datepicker({
             minDate: 0 
         }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>-->

<!--for dd/mm/yyyy format-->
<script>
       $(function(){
        $('.datepicker').datepicker({ minDate: 0 , dateFormat: 'dd/mm/yy' }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>


<script>
    var newWin=null;
    function openLookupPopup(name, id)
    {
        var url="/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
        newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
    }
                  
    function closeLookupPopup()
    {
       if (null!=newWin)
       {
          newWin.close();
       }  
    }
    
  
    
     function doCheckboxChange(cb,itemId){ 
            if(cb.checked==true){
                aSelectItem(itemId);
            }
            else{
                aDeselectItem(itemId);
            }
        }
</script>

    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
   
    <apex:form >
    <apex:pageBlock >    
      <apex:pageBlockSection >    
        <apex:pageBlockSectionItem >
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1" >
                <apex:selectOptions value="{!Actions}"/>
                <apex:actionSupport event="onchange" action="{!getDisplayAccount}" reRender="panel"/>             
            </apex:selectList>
           </apex:pageBlockSectionItem>
           </apex:pageBlockSection>
      <apex:outputPanel >        
       <apex:pageBlockSection >     
           <apex:pageBlockSectionItem >          
           <apex:outputLabel value="Target Account"/>        
           <apex:outputPanel id="panel" >
            <apex:inputHidden value="{!acctId}" id="targetId"/>
            <apex:inputText size="40" value="{!accountName}" id="targetName" onFocus="this.blur()" disabled="{!!AccountBool}"/>&nbsp;
            
            <apex:outputLink rendered="{!AccountBool}" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</apex:outputLink>                    
          </apex:outputPanel>          
      </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      </apex:outputPanel>
               <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                <!--Date: <apex:input type="date" value="{!dat}" required="false"/>--> 
                Effective From:<apex:inputText id="datepicker" styleClass="datepicker"  value="{!currentDateValue}" required="false"/>              
            </apex:pageBlockSectionItem>           
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>       
    </apex:pageBlock>   
        
        <!-- handle selected item -->
        <apex:actionFunction name="aSelectItem" action="{!doSelectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <!-- handle deselected item -->
        <apex:actionFunction name="aDeselectItem" action="{!doDeselectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>        
         <apex:pageBlock title="Select Subscriptions" id="mpb">        
            <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
            <apex:pageBlockTable value="{!Subscriptions}" var="c">
                <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>                       
                            <apex:inputCheckbox value="{!c.selected}" id="inputId" disabled="{!NOT(c.sub.csord__Status__c=='Active') && (c.sub.MACD_in_progress__c=False)}" onchange="doCheckboxChange(this,'{!c.sub.Id}')"/>
                            
                    </apex:column>           
                 <apex:column headerValue="Subscription Name" >                       
                       <apex:outputLink value="/{!c.sub.Id}" target="_blank"> {!c.sub.Name} </apex:outputLink>
                   </apex:column>
                <apex:column value="{!c.sub.csord__Status__c}"/>                
                           
            </apex:pageBlockTable>
            </apex:pageblockSection>
           
        <apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}" title="First Page"/>
        <apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
        <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
        <apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next Page"/>
        <apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last Page"/>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Continue "  />
                <apex:commandButton value="Back" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
        </apex:pageBlock>        
    </apex:form>
</apex:page>
screen shot
This forum has helped me out earlier also and i am very hopeful that you people will help me out this time also.
Please fine tune my code wherever applicable.

Many thanks in advance.
 
Hi All,
I have a requiremnt which i am describing below:
There is a button called "Continue" on UI. When an user clicks on it it will redirect to some other page. But prior to that one validations need to be done. As you people can see in the screen shot which i attached here is there is checkbox along with the name of each subscription. So my requirement is if an user does not select any single subscription with "Active" status and if user clicks on proceed button an error message must be thrown "Please select al least one active subscription".
I am attaching the corresponding code and Visual force page with the screen shot.
public with sharing class AccountActionsWrapper
{       
    public String contextItem{get;set;}   
    public set<Id> selectedContactIds{get;set;}
    public String accountName {get; set;}
    public string accountid;
    public String selectedActions{get;set;}
    public boolean AccountBool{get;set;}
    public List<Account> accounts {get; set;}
    public List<csord__Service__c> vLstServ{ get; set; }
    public Id acctId {get; set;}
    public integer size{get;set;}
    public Map<Id, List<csord__Service__c>> memIdServListMap { get; set; }
    public integer noOfRecords{get;set;}
    public Date dat {get;set;}
    Set<Id> SubIds = new Set<Id>();
    public boolean Display{get;set;}
     Map<Id, csord__Subscription__c> subMap = new Map<Id, csord__Subscription__c>();
    public List<csord__Subscription__c>vLstSubscriptions{get;set;}
    public List<wrapSubscription> wrapSubscriptionList {get; set;}
    public List<csord__Subscription__c> selectedSubscriptions{get;set;} 
    public Boolean isCancel{get;set;}
    public String query {get; set;}
    public String dateError {get;set;}
    public String currentDateValue { get; set; }

    public ApexPages.StandardSetController setCon {
        get{
            if(setCon == null){
           size =20; 
           accountid=ApexPages.currentPage().getParameters().get('id');
           selectedContactIds= new Set<Id>();       
           setCon= new ApexPages.StandardSetController( [select Id, Name,csord__Status__c,MACD_in_progress__c , csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid] );
           this.setCon.setpageNumber(1);
           setCon.setPageSize(size);
           noOfRecords = setCon.getResultSize();            
            }
            return setCon;
        }set;
    }
    
     public AccountActionsWrapper() 
     {
       selectedActions='Take Over';
       if(selectedActions=='Take Over')
       {
          AccountBool=true; 
       } 
      }
        
    public List<SelectOption> getActions() {
        List<SelectOption> Actions= new List<SelectOption>();
        Actions.add(new SelectOption('Take Over','Take Over'));
        Actions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        Actions.add(new SelectOption('Move','Move'));
        return Actions;
    }
    public void getDisplayAccount()
    {
        if(selectedActions!='Take Over')
        {
           AccountBool=false; 
        }
        else
        {
             AccountBool=true;
        }
    }
    
    //function to get date value    
     public void getValue(){
      System.debug('*************'+currentDateValue);
      
    
     }
     
     //Function to retrieving account detail in pop-up upon clicking on Lookup in VF page
     public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }   
    
    public void doSelectItem()
    {
      this.selectedContactIds.add(this.contextItem);
    } 
    public void doDeselectItem()
    {
      this.selectedContactIds.remove(this.contextItem);
    } 
    public Integer getSelectedCount()
    {
      return this.selectedContactIds.size();
    }
    public void doNext()
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
    } 
    public void doPrevious()
    {
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doStart() 
    { 
      if(this.setCon.getHasPrevious())
         this.setCon.previous();
    }
    public void doEnd() 
    { 
      if(this.setCon.getHasNext())
         this.setCon.next();
   }
     
    public List<wrapSubscription> getSubscriptions()
    { 
        
        List<wrapSubscription> rows = new List<wrapSubscription>(); 
        //vLstSubscriptions = [select Id, Name,csord__Status__c, csord__Account__c,(select Id,Billing_Account_Number__c from csord__Services__r) from csord__Subscription__c where csord__Account__c=:accountid limit 100];
        for(sObject r : this.setCon.getRecords())
        {
            csord__Subscription__c c = (csord__Subscription__c)r;
            wrapSubscription row = new wrapSubscription(c,vLstServ);
            if(this.selectedContactIds.contains(c.Id))
            {
                row.selected=true;
            }
            else
            {
                row.selected=false;
            }
            rows.add(row);
        }
        return rows;
         
    }
    public PageReference cancel()
    {
        return new PageReference('/'+accountid);
    }
    public Boolean getHasPrevious()
    { 
        return this.setCon.getHasPrevious();
    } 
    public Boolean getHasNext()
    {
       return this.setCon.getHasNext(); 
    }  
    public Integer getPageNumber()
    {
       return this.setCon.getPageNumber();
    } 
    Public Integer getTotalPages()
    {
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
        Decimal pages = totalSize/pageSize; 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }  
    public class wrapSubscription
    { 
        public csord__Subscription__c sub {get; set;}        
        public Boolean selected {get; set;}
        public List<csord__Service__c> Serv{get;set;}
        public wrapSubscription(csord__Subscription__c c,List<csord__Service__c> vLstServ)
        {
            this.sub=c;
            this.Serv=vLstServ;
            this.selected=false;
        }
 
    }
}
<apex:page docType="html-5.0" controller="AccountActionsWrapper" sidebar="false" showHeader="false" id="pg" >

<head>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
</head>


<!--for mm/dd/yyyy format-->
<!--<script>
       $(function(){
        $('.datepicker').datepicker({
             minDate: 0 
         }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>-->

<!--for dd/mm/yyyy format-->
<script>
       $(function(){
        $('.datepicker').datepicker({ minDate: 0 , dateFormat: 'dd/mm/yy' }).on('changeDate', function(ev){
            $('#sDate1').text($('#datepicker').data('date'));
            $('#datepicker').datepicker('hide');
        });
    
    })
</script>


<script>
    var newWin=null;
    function openLookupPopup(name, id)
    {
        var url="/apex/LookupExamplePopup?namefield=" + name + "&idfield=" + id;
        newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
        if (window.focus) 
        {
            newWin.focus();
        }
            
        return false;
    }
                  
    function closeLookupPopup()
    {
       if (null!=newWin)
       {
          newWin.close();
       }  
    }
    
  
    
     function doCheckboxChange(cb,itemId){ 
            if(cb.checked==true){
                aSelectItem(itemId);
            }
            else{
                aDeselectItem(itemId);
            }
        }
</script>

    <script type="text/javascript">
        function selectAllCheckboxes(obj,receivedInputID){
            var inputCheckBox = document.getElementsByTagName("input");
            for(var i=0; i<inputCheckBox.length; i++){
                if(inputCheckBox[i].id.indexOf(receivedInputID)!=-1){
                    inputCheckBox[i].checked = obj.checked;
                }
            }
        }
    </script>
   
    <apex:form >
    <apex:pageBlock >    
      <apex:pageBlockSection >    
        <apex:pageBlockSectionItem >
        Select the Action:
        <!--<apex:outputPanel>-->
          <apex:selectList value="{!selectedActions}" multiselect="false" size="1" >
                <apex:selectOptions value="{!Actions}"/>
                <apex:actionSupport event="onchange" action="{!getDisplayAccount}" reRender="panel"/>             
            </apex:selectList>
           </apex:pageBlockSectionItem>
           </apex:pageBlockSection>
      <apex:outputPanel >        
       <apex:pageBlockSection >     
           <apex:pageBlockSectionItem >          
           <apex:outputLabel value="Target Account"/>        
           <apex:outputPanel id="panel" >
            <apex:inputHidden value="{!acctId}" id="targetId"/>
            <apex:inputText size="40" value="{!accountName}" id="targetName" onFocus="this.blur()" disabled="{!!AccountBool}"/>&nbsp;
            
            <apex:outputLink rendered="{!AccountBool}" onclick="openLookupPopup('{!$Component.targetName}', '{!$Component.targetId}'); return false">Lookup</apex:outputLink>                    
          </apex:outputPanel>          
      </apex:pageBlockSectionItem>
      </apex:pageBlockSection>
      </apex:outputPanel>
               <apex:PageBlockSection >
            <apex:pageBlockSectionItem >
                <!--Date: <apex:input type="date" value="{!dat}" required="false"/>--> 
                Effective From:<apex:inputText id="datepicker" styleClass="datepicker"  value="{!currentDateValue}" required="false"/>              
            </apex:pageBlockSectionItem>           
            <!--<apex:input value="{!myDate}" id="theTextInput" type="date"/>-->
        </apex:pageBlockSection>       
    </apex:pageBlock>   
        
        <!-- handle selected item -->
        <apex:actionFunction name="aSelectItem" action="{!doSelectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>
 
        <!-- handle deselected item -->
        <apex:actionFunction name="aDeselectItem" action="{!doDeselectItem}" rerender="mpb">
            <apex:param name="contextItem" value="" assignTo="{!contextItem}"/>
        </apex:actionFunction>        
         <apex:pageBlock title="Select Subscriptions" id="mpb">        
            <apex:pageblockSection title="Subscriptions" collapsible="false" columns="1" >
            <apex:pageBlockTable value="{!Subscriptions}" var="c">
                <apex:column >
                        <apex:facet name="header">
                            <apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
                        </apex:facet>                       
                            <apex:inputCheckbox value="{!c.selected}" id="inputId" disabled="{!NOT(c.sub.csord__Status__c=='Active') && (c.sub.MACD_in_progress__c=False)}" onchange="doCheckboxChange(this,'{!c.sub.Id}')"/>
                            
                    </apex:column>           
                 <apex:column headerValue="Subscription Name" >                       
                       <apex:outputLink value="/{!c.sub.Id}" target="_blank"> {!c.sub.Name} </apex:outputLink>
                   </apex:column>
                <apex:column value="{!c.sub.csord__Status__c}"/>                
                           
            </apex:pageBlockTable>
            </apex:pageblockSection>
           
        <apex:commandButton value="First" action="{!setCon.first}" disabled="{!!setCon.hasPrevious}" title="First Page"/>
        <apex:commandButton value="Previous" action="{!setCon.previous}" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
        <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
        <apex:commandButton value="Next" action="{!setCon.next}" disabled="{!!setCon.hasNext}" title="Next Page"/>
        <apex:commandButton value="Last" action="{!setCon.last}" disabled="{!!setCon.hasNext}" title="Last Page"/>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Continue "  />
                <apex:commandButton value="Back" action="{!cancel}" immediate="true" />
            </apex:pageBlockButtons>
        </apex:pageBlock>        
    </apex:form>
</apex:page>
screen shot

This forum has helped me out earlier also and i am very hopeful that you people will help me out this time also.
Please fine tune my code wherever applicable.

Many thanks in advance.


 
Hi All,
I have an urgent requirement for test class creation.I have posted my controller code here.If possible,any one from developer community can provide me a test class code for my controller.It would be really very helpful for me as i am very new to salesforce and this is very urgent requirement needs to complete asap.
public class ControllerWrapper{

private Set<Id> selectedContactIds;

//Our collection of the class/wrapper objects 
public List<wrapSubscription> wrapSubscriptionList {get; set;}
public List<csord__Subscription__c> selectedSubscriptions{get;set;}
public Boolean isCancel{get;set;}
public string accountid;
public String selectedActions{get;set;}
public Date dat {get;set;}
public String query {get; set;}
public List<Account> accounts {get; set;}
public Id acctId {get; set;}
public String accountName {get; set;}
    
//Constructor class   
public ControllerWrapper(){
    accountid=ApexPages.currentPage().getParameters().get('id');
        if(wrapSubscriptionList == null) {
           wrapSubscriptionList= new List<wrapSubscription>();
            for(csord__Subscription__c s: [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid LIMIT 20]) {
                // As each Account is processed we create a new wrapAccount object and add it to the wrapAccountList
                wrapSubscriptionList.add(new wrapSubscription(s));
            }
        }
    }

//function for calling dummy lookup field which is created on vf page 
public PageReference runQuery()
    {
        List<List<Account>> searchResults=[FIND :query IN ALL FIELDS RETURNING Account (id, name, billingstreet, billingcity, billingpostalcode)];
        accounts=searchResults[0];
        return null;
    }
    

//function for selection of values from dummy picklist field "Action"
public List<SelectOption> getActionsOptions() {
        List<SelectOption> actionOptions = new List<SelectOption>();
        actionOptions.add(new SelectOption('','-None-'));
        actionOptions.add(new SelectOption('Take Over','Take Over'));
        actionOptions.add(new SelectOption('Invoice Switch','Invoice Switch'));
        actionOptions.add(new SelectOption('Move','Move'));
                return actionOptions;
}
   

//Function for pagination logic
public ApexPages.StandardSetController setCon {
get {
    if(setCon == null) {
         setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
            [select Id, Name,csord__Status__c, csord__Account__c from csord__Subscription__c where csord__Account__c=:accountid ]));
                             }
                        return setCon;
                }
        set;
    }
public List<csord__Subscription__c > getWrapSubscriptionList() {
         
          setCon.setpagesize(20);
         setCon.setpageNumber(1);
         return (List<csord__Subscription__c >) setCon.getRecords();
    }


//Method for obtaining current page no.
public Integer getPageNumber(){
 
        return this.setCon.getPageNumber();
 
    }
    

 

//Function returns the total no pages 
Public Integer getTotalPages(){
 
        Decimal totalSize = this.setCon.getResultSize();
        Decimal pageSize = this.setCon.getPageSize();
 
        Decimal pages = totalSize/pageSize;
 
        return (Integer)pages.round(System.RoundingMode.CEILING);
    }             
                  

     
//Function to call Proceed button    
public void processSelected() {
    selectedSubscriptions = new List<csord__Subscription__c>();
 
        for(wrapSubscription wrapSubscriptionObj : wrapSubscriptionList) {
            if(wrapSubscriptionObj.selected == true) {
                selectedSubscriptions.add(wrapSubscriptionObj.sub);
            }
        }
    }
    
//Function to process the Cancel Button
public PageReference cancel(){
        return new PageReference('/'+accountid);
    }
    
//Method for calling Next Button
public void next(){

    if(this.setCon.getHasNext())
        this.setCon.next();

    }

//Method for calling Previous Button
public void previous(){

    if(this.setCon.getHasPrevious())
        this.setCon.previous();

    }
    
    
 
                         
 
// This is our wrapper/container class. In this example a wrapper class contains both the custom object Subscription and a Boolean value
public class wrapSubscription {
        public csord__Subscription__c sub {get; set;}
        public Boolean selected {get; set;}
 
        public wrapSubscription(csord__Subscription__c s) {
            sub = s;
            selected = false;
        }
    }
}
You people have helped me alot earlier and this time also i am very optimistic about the same.I am seeking help from last 2 days here.
This is urgent requiremnt.
Many thanks in advance.