• chaitanya salesforcecrm
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 3
    Replies
I have a formula where i need to substitute forward slash "\" with double forward slash "\\".below is the formula 

HYPERLINK("file:///"&SUBSTITUTE(SUBSTITUTE(Project_Files_Path__c," ","%20"),"\","\\"),Project_Files_Path__c)

when i check the syntax i am getting below error

User-added image
kindly let me know any suggestions to resolve the issue?
User-added image
I want to display the text Resdential for Sale,Resdential for Rent,Hotel,Retail,Office and Parking in the first row which are only Labels.
i have written below visualforce code
<apex:page standardController="Development_Project__c">
<apex:form >


            <apex:pageBlockSection columns="1">
               <apex:pageBlockTable value="{!Development_Project__c}" var="dp" columnsWidth="10%,5%,5%,5%,5%,5%,5%">
                   <apex:column>
                         <apex:facet name="header">
                       </apex:facet>
                    </apex:column>

                   <apex:column  headerValue="#Units">
                       <apex:inputfield value="{!Development_Project__c.Residential_for_Sale_Total_Unit_Size__c}"/>
                   </apex:column>
                   <apex:column  headervalue="GSF">
                       <apex:inputField value="{!Development_Project__c.Residential_for_Sale_Total_Gross_sf__c}"/>
                   </apex:column>
                   <apex:column  headervalue="NSF">
                       <apex:inputField value="{!Development_Project__c.Residential_for_Sale_Total_Net_sf__c}"/>
                   </apex:column>
                   <apex:column  headervalue="EFF%" />
                   <apex:column  headervalue="AVG Unit" />
                   <apex:column  headervalue="F to F Height" />


            </apex:pageBlockTable>

        </apex:pageBlockSection>

    </apex:form>
  </apex:page>
with the above code i am able to achieve the below table 
User-added image
 
I have two lists(mainGroupLinkerIPGlist and toCopy) i am trying to remove all the values of mainGroupLinkerIPGlist from toCopy by creating a set and adding both the lists to the IPGset. below is the apex code.
 
List<Intralinks_Group_and_Contact_Links__c> mainGroupLinkerIPGlist = [SELECT Id,Intralinks_Portal_Group__c FROM Intralinks_Group_and_Contact_Links__c where Contact__c = :mainGroupLinker.Contact__c];
        //system.debug('mainGroupLinkerIPGlist =' + mainGroupLinkerIPGlist.size());

    //query all the Groups the copyFrom contact has
    if(copyFrom.Contact__c != null) {
       List<Intralinks_Group_and_Contact_Links__c> toCopy = [SELECT Id,Intralinks_Portal_Group__c FROM Intralinks_Group_and_Contact_Links__c where Contact__c = :copyFrom.Contact__c];

         system.debug('toCopy =' + toCopy.size());

         set<Intralinks_Group_and_Contact_Links__c> IPGset = New set<Intralinks_Group_and_Contact_Links__c>(toCopy);

         boolean result = IPGset.removeall(mainGroupLinkerIPGlist);
         System.assertEquals(true, result);
         system.debug('mainGroupLinkerIPGlist Count=' + mainGroupLinkerIPGlist.size());
         system.debug('IPGset count=' + IPGset.size());

when i am trying to remove all the mainGroupLinkerIPGlist values from set it is not removing and i am getting below message. System.AssertException: Assertion Failed: Expected: true, Actual: false
In the contact object i have a related list "Intralink Portal group" each contact can have multiple Intralink Porta groups. i have created a visual force page to add more than one intralink portal groups to a contact.now i want to select the Intralink Portal groups from one contact and add all of them to a new contact.how to do it? below is the visualforce page code and controller code.through controller i am able to add intralink portal groups to contact.but i am not able to copy all the list of intralink portal groups from one contact to another. below is the vf pageUser-added image
<apex:page Controller="ilGroupCtrl" doctype="html-5.0">
<apex:form >
    <apex:pageBlock title="Add Intralinks Groups">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save"/>
            <apex:commandButton action="{!Cancel}" value="Cancel"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection columns="1" id="main">
            <apex:inputField value="{!mainGroupLinker.Contact__c}" />

            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Copy From" />
                <apex:inputField value="{!copyFrom.Contact__c}" required="false"/>
            </apex:pageBlockSectionItem>

            <apex:repeat value="{!groupList}" var="groupObj">
                <apex:pageBlockSectionItem >
                <apex:outputLabel value="Intralinks Group" />
                <apex:inputField value="{!groupObj.Intralinks_Portal_Group__c}" required="false"/>
            </apex:pageBlockSectionItem>
            </apex:repeat>
            <apex:commandButton action="{!add}" value="Add" rerender="main"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>

Apex Controller
 
public class ilGroupCtrl {

Map<String, String> params;

public Intralinks_Group_and_Contact_Links__c mainGroupLinker { get; set; }
public Intralinks_Group_and_Contact_Links__c copyFrom { get; set; }
public List<Intralinks_Group_and_Contact_Links__c> groupList { get; set; }

public ilGroupCtrl() {
    params = ApexPages.currentPage().getParameters();
    mainGroupLinker = new Intralinks_Group_and_Contact_Links__c();
    copyFrom = new Intralinks_Group_and_Contact_Links__c();
    groupList = new List<Intralinks_Group_and_Contact_Links__c>();

    // if QueryString contains a contact Id, autofill the Contact field
    if(params.containsKey('cid')) {
        mainGroupLinker.Contact__c = params.get('cid');
    }

    groupList.add(mainGroupLinker);
}

public void add() {
    groupList.add(new Intralinks_Group_and_Contact_Links__c(Contact__c=mainGroupLinker.Contact__c));
    return;
}

public PageReference save() {
    List<Intralinks_Group_and_Contact_Links__c> toAdd = new List<Intralinks_Group_and_Contact_Links__c>();

    //query all the Groups the copyFrom contact has
    if(copyFrom.Contact__c != null) {
       List<Intralinks_Group_and_Contact_Links__c> toCopy = [SELECT Intralinks_Portal_Group__c FROM Intralinks_Group_and_Contact_Links__c where Contact__c = :copyFrom.Contact__c];

        for(Intralinks_Group_and_Contact_Links__c copyGroup : toCopy) {
            Intralinks_Group_and_Contact_Links__c newCopy = new Intralinks_Group_and_Contact_Links__c(Contact__c= mainGroupLinker.Contact__c,Intralinks_Portal_Group__c= copyGroup.Intralinks_Portal_Group__c);


        }

   }

    for (Intralinks_Group_and_Contact_Links__c g : groupList) {
        // save it if it's not null.
        if(g.Intralinks_Portal_Group__c != null) {
            toAdd.add(g);

        }
    }

    System.debug('toAdd count: ' + toAdd.size());
    if(toAdd.size() > 0) {

        insert toAdd;
    }

    return null;
}

  Public Pagereference Cancel(){
   Pagereference Page = new         PageReference(ApexPages.currentPage().getParameters().get('https://cs16.salesforce.com/{!mainGroupLinker.Contact__c}'));  
 return Page;
      }
   }

 
Below is the apex class which i have written to insert data in to related list on contact.i am not getting error while executing the class but the data in not getting saved in the related list object.kindly let me know where i am doing wrong?
 
public class IntralinksExtension {

    public IntralinksExtension(ApexPages.StandardSetController controller) {

    }
         Public Contact Cont{get;set;}
         public String ContactId {get;set;}
         public string IntragroupId {get;set;}

  
Public void Save(){


            ContactId = ApexPages.CurrentPage().getparameters().get('Id');
            IntragroupId = ApexPages.CurrentPage().getparameters().get('ILPG1');
            
            List<Contact> Cnt = New List<Contact>([select Id,Name,(select Id,Name from Intralinks_Group_and_Contact_Links__r)from Contact where Id=:ContactId]);
            if(!Cnt.isEmpty()){
                Cnt[0].Intralinks_Group_and_Contact_Links__r[0].Contact__c = ContactId;
                Cnt[0].Intralinks_Group_and_Contact_Links__r[0].Intralinks_Portal_Group__c = IntragroupId;
            insert Cnt; 
            }
           
         
         

}

 
Below is the Apex Controller and Test Class which i have written for it.
public with sharing class Condosearchcontroller { 
   
    
    public list <Condo__c> Cond {get;set;}
    public String LeadRecordId {get;set;}
    public string beds {get;set;} 
    public string squarefootage {get;set;}
    public String SFminimum {get;set;}
    public String SFmaximum {get;set;}
    public string InitialListPrice {get;set;}
    public String ILPminimum {get;set;}
    public String ILPmaximum {get;set;}
    public string Unitnamevf {get;set;}
    public Boolean refreshPage {get; set;}
    
    public Condosearchcontroller() {

    } 
    
public Condosearchcontroller(ApexPages.StandardController controller) {

  
   }  
   
public List<SelectOption> getbedsOptions() {
        List<SelectOption> bedsoptions = new List<SelectOption>();
        bedsoptions.add(new SelectOption('','ALL'));
        bedsoptions.add(new SelectOption('0','0'));
        bedsoptions.add(new SelectOption('1','1'));
        bedsoptions.add(new SelectOption('2','2'));
        bedsoptions.add(new SelectOption('3','3'));
        
        return bedsoptions;
    }
    
    
public PageReference  Search(){
        
        
        String SFmin = SFminimum.remove(',');
        String SFmax = SFmaximum.remove(','); 
        String ILPmin = ILPminimum.remove(',');
        String ILPmax = ILPmaximum.remove(',');
       
        string searchquery= 'select name,Beds__c,Square_Footage__c,Initial_List_Price__c,Status__c from Condo__c where name!=null and Status__c in (\'Available\',\'Unsold\') ';
           
               
               if (beds == 'ALL'){
                   searchquery+= ' and Beds__c = 0,1,2,3 ';
                  }
                  else 
                if (beds >= '0'){
                   searchquery+= ' and Beds__c = '+beds+'';
                   }
                   else
                   
                if (SFminimum > '0' && SFmaximum >'0') {
                   searchquery+= ' and Square_Footage__c >= '+SFmin+' and Square_Footage__c <= '+SFmax+' ';
                   }
                   else
                if (ILPminimum > '0' && ILPmaximum >'0') {
                   searchquery += 'and Initial_List_Price__c >= '+ILPmin+' and Initial_List_Price__c <= '+ILPmax+' ';
                     }
                     
                
                if (beds >= '0' && SFminimum >'0' && SFmaximum > '0'){
                   searchquery+= ' and Beds__c = '+beds+' and Square_Footage__c >= '+SFmin+' and Square_Footage__c <= '+SFmax+' '; 
                   }
                    else
                 if (beds >= '0' && ILPminimum > '0' && ILPmaximum >'0'){
                           
                     searchquery += 'and Beds__c = '+beds+' and Initial_List_Price__c >= '+ILPmin+' and Initial_List_Price__c <= '+ILPmax+' ';
                     }
                     
                  if(beds >= '0' && SFminimum >'0' && SFmaximum >'0' && ILPminimum >'0' && ILPmaximum >'0'){
                               
                     searchquery += ' and Beds__c = '+beds+' and Square_Footage__c >= '+SFmin+' and Square_Footage__c <= '+SFmax+' and Initial_List_Price__c >= '+ILPmin+' and Initial_List_Price__c <= '+ILPmax+' ';
                      }
                      else
                 if(beds >= '0' && SFminimum >'0') {
                  
                      searchquery += ' and Beds__c = '+beds+' and Square_Footage__c  >= '+SFmin+' ';
                     }
                      else
                  if(beds >= '0' && SFmaximum > '0') {
                  
                      searchquery += ' and Beds__c = '+beds+' and Square_Footage__c  <= '+SFmax+' ';
                      }
                      else
                  if(beds >= '0' && ILPminimum > '0') {
                     
                     searchquery += ' and Beds__c = '+beds+' and Initial_List_Price__c  >= '+ILPmin+' ';
                     }
                     else
                   if(beds >= '0' && ILPmaximum > '0') {
                   
                     searchquery += ' and Beds__c = '+beds+' and Initial_List_Price__c  <= '+ILPmax+' ';
                     }
                     else
                   if(SFminimum > '0') {
                  
                      searchquery += ' and Square_Footage__c >= '+SFmin+' ';
                     }
                     else
                     if(SFmaximum >'0') {
                  
                      searchquery += ' and Square_Footage__c  <= '+SFmax+' ';
                      }
                      else
                     if(ILPminimum > '0')
                     {
                       searchquery += ' and Initial_List_Price__c  >= '+ILPmin+'';
                     }
                     else
                     if(ILPmaximum > '0') {
               
                     searchquery += ' and Initial_List_Price__c  <= '+ILPmax+' ';
                   }
                   
                   if ( SFmin != null && SFmin.isAlpha() ||  SFmax != null && SFmax.isAlpha() ||  ILPmin != null && ILPmin.isAlpha() ||   ILpmax != null && ILPmax.isAlpha()){
           ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'Please enter Numerical values for SquareFootage and Price Fields'));
            }
              else    
           cond = Database.query(searchquery);
           return null;
   }
   
Public Pagereference addtolead() {
Id UnitId;

  Unitnamevf = System.currentPageReference().getParameters().get('UnitNameParam');
  LeadRecordId = ApexPages.CurrentPage().getparameters().get('id');

 List<Lead> Lds = new List<Lead>([select Id,Unit__c from Lead where Id= :LeadRecordId]);
 List<Condo__c> Cnd = New List<Condo__c>([select Id,Name from Condo__c where Name= :Unitnamevf]);
       if(!Cnd.isEmpty()){
        UnitId = Cnd[0].Id; 
        Lds[0].Unit__c = UnitId; 
          update Lds[0];
            }
            
    refreshPage=true;  
    return null;
    }


public void Reset(){ 

    beds = null;
    SFminimum = null;
    SFmaximum = null;
    ILPminimum = null;
    ILPmaximum = null;
    if(Cond != null) {
    Cond.clear();
 }
   }
  
 }
when i run the below test class
@isTest
Public Class TestCondosearchcontroller {

static  Testmethod void Bedstestmethod(){
String SFmin;
String SFmax;
String ILPmin;
String ILPmax;

//create a CIM Asset
        CIM_Assets__c myAsset = new CIM_Assets__c(Name='condolistname1',Property_Type__c='Condo');
        insert myAsset;
        
        //create some condo's and add to the asset
        Condo__c Cnd1 = new Condo__c(CIM_Assets__c=myAsset.Id,Beds__c=1,Initial_List_Price__c=1200000,Status__c='UnSold',Square_Footage__c = 1000);
        Condo__c Cnd2 = new Condo__c(CIM_Assets__c=myAsset.Id,Beds__c=0,Initial_List_Price__c=1500000,Status__c='Available',Square_Footage__c = 1200);
        
        Condo__c Cnd3 = new Condo__c(CIM_Assets__c=myAsset.Id,Beds__c=2,Initial_List_Price__c=1300000,Status__c='UnSold',Square_Footage__c = 1300);
        Condo__c Cnd4 = new Condo__c(CIM_Assets__c=myAsset.Id,Beds__c=3,Initial_List_Price__c=1400000,Status__c='Sold',Square_Footage__c = 1400);
        
        Condo__c Cnd5 = new Condo__c(CIM_Assets__c=myAsset.Id,Beds__c=1,Initial_List_Price__c=1345000,Status__c='Sold',Square_Footage__c = 850);
        Condo__c Cnd6 = new Condo__c(CIM_Assets__c=myAsset.Id,Beds__c=1,Initial_List_Price__c=1450000,Status__c='Available',Square_Footage__c = 1350);
        
        Condo__c[] allCondos = new Condo__c[]{Cnd1,Cnd2,Cnd3,Cnd4,Cnd5,Cnd6};
        insert allCondos;
    
    PageReference pageRef = Page.CondosSearchPage;
    pageRef.getParameters().put('beds', 'ALL');
    pageRef.getParameters().put('SFmin', '500');
    pageRef.getParameters().put('SFmax', '1500');
    pageRef.getParameters().put('ILPmin', '1,000,000');
    pageRef.getParameters().put('ILPmax', '1,500,000');
    Test.setCurrentPageReference(pageRef);

    
    Condosearchcontroller cndser =new Condosearchcontroller();
    cndser.Search();
    
}



static Testmethod void getBedsOptions(){

Test.StartTest();
Condosearchcontroller cndser = new Condosearchcontroller();
  cndser.getbedsOptions();
  Test.StopTest();

}
static Testmethod void AddtoLead(){

string Unitnamevf = 'R2-202';
Id UnitId; 
Boolean Refreshpage;

CIM_Assets__c CIM = New CIM_Assets__c();
CIM.name = 'Test CIM';
CIM.Property_Type__c = 'Condo';
insert CIM; 

Condo__c Cnd2 = New Condo__c();
//Cnd2.name = 'R1-10111';
Cnd2.CIM_Assets__c = CIM.Id; 
insert Cnd2;

Lead ld = New Lead();
ld.LastName = 'Test Lead';
ld.Company = 'Test Company';
insert ld;

Test.StartTest();
if(Cnd2 != null){
UnitId = Cnd2.Id;
ld.Unit__c = UnitId;
Update ld;
}
Condosearchcontroller cndser = new Condosearchcontroller();
      cndser.addtolead();
      Test.StopTest();
}


static Testmethod void Reset(){

    String beds = '3';
    String SFmin = '500';
    String SFmax = '1000';
    String ILPmin = '1,000,000';
    String ILPmax = '1,500,000';
    
    test.starttest();
    Condosearchcontroller cndser = new Condosearchcontroller();
      cndser.Reset();
      Test.StopTest();
  
}
}



I am constantly getting a error message saying
TestCondosearchcontroller
Bedstestmethod
Fail
System.NullPointerException: Attempt to de-reference a null object
Class.Condosearchcontroller.Search: line 40, column 1 Class.TestCondosearchcontroller.Bedstestmethod:
 line 59, column 1​
public with sharing class Condosearchcontroller { 
   public Condosearchcontroller() {

    }
    
    public list <Condo__c> Cond {get;set;}
    public String LeadRecordId {get;set;}
    public string beds {get;set;} 
    public string squarefootage {get;set;}
    public String SFminimum {get;set;}
    public String SFmaximum {get;set;}
    public string InitialListPrice {get;set;}
    public String ILPminimum {get;set;}
    public String ILPmaximum {get;set;}
    public string Unitnamevf {get;set;}
    public Boolean refreshPage {get; set;}
    
     
    
public Condosearchcontroller(ApexPages.StandardController controller) {

  
   }  
   
public List<SelectOption> getbedsOptions() {
        List<SelectOption> bedsoptions = new List<SelectOption>();
        bedsoptions.add(new SelectOption('','ALL'));
        bedsoptions.add(new SelectOption('0','0'));
        bedsoptions.add(new SelectOption('1','1'));
        bedsoptions.add(new SelectOption('2','2'));
        bedsoptions.add(new SelectOption('3','3'));
        
        return bedsoptions;
    }


public PageReference  Search(){

        string searchquery= 'select name,Beds__c,Square_Footage__c,Initial_List_Price__c,Status__c from Condo__c where name!=null and Status__c in (\'Available\',\'Unsold\') ';
           
               
               if (beds >= '0')
                   searchquery+= ' and Beds__c = '+beds+'';
              
                if (SFminimum > '0' && SFmaximum > '0') 
                   searchquery+= ' and Square_Footage__c >= '+SFminimum+' and Square_Footage__c <= '+SFmaximum+' ';
                   
               
                if (ILPminimum >'0' && ILPmaximum > '0')
                   searchquery += 'and Initial_List_Price__c >= '+ILPminimum+' and Initial_List_Price__c <= '+ILPmaximum+' ';

                    
                if (beds >= '0' && SFminimum > '0' && SFmaximum > '0')
                   searchquery+= ' and Beds__c = '+beds+' and Square_Footage__c >= '+SFminimum+' and Square_Footage__c <= '+SFmaximum+' '; 
                    
                 if (beds >= '0' && ILPminimum > '0' && ILPmaximum > '0')
                           
                     searchquery += 'and Beds__c = '+beds+' and Initial_List_Price__c >= '+ILPminimum+' and Initial_List_Price__c <= '+ILPmaximum+' ';
                     
                  if(beds >= '0' && SFminimum > '0' && SFmaximum > '0' && ILPminimum > '0' && ILPmaximum > '0')
                               
                     searchquery += ' and Beds__c = '+beds+' and Square_Footage__c >= '+SFminimum+' and Square_Footage__c <= '+SFmaximum+' and Initial_List_Price__c >= '+ILPminimum+' and Initial_List_Price__c <= '+ILPmaximum+' ';

                 if(beds >= '0' && SFminimum > '0')
                  
                      searchquery += ' and Beds__c = '+beds+' and Square_Footage__c  >= '+SFminimum+' ';
                      
                  if(beds >= '0' && SFmaximum > '0')
                  
                      searchquery += ' and Beds__c = '+beds+' and Square_Footage__c  <= '+SFmaximum+' ';
                      
                  if(beds >= '0' && ILPminimum > '0')
                     
                     searchquery += ' and Beds__c = '+beds+' and Initial_List_Price__c  >= '+ILPminimum+' ';
                     
                   if(beds >= '0' && ILPmaximum > '0')
                     
                     searchquery += ' and Beds__c = '+beds+' and Initial_List_Price__c  <= '+ILPmaximum+' ';
                     
                   if(SFminimum > '0')
                  
                      searchquery += ' and Square_Footage__c >= '+SFminimum+' ';
                     
                     if(SFmaximum > '0')
                  
                      searchquery += ' and Square_Footage__c  <= '+SFmaximum+' ';
                      
                     if( ILPminimum > '0')
                   
                       searchquery += ' and Initial_List_Price__c  >= '+ILPminimum+'';
                  
                     if(ILPmaximum > '0')
               
                     searchquery += ' and Initial_List_Price__c  <= '+ILPmaximum+' ';
           
           if (SFminimum.isAlpha() || SFmaximum.isAlpha() || ILPminimum.isAlpha() || ILPmaximum.isAlpha()){
           ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'Please enter Numerical values for SquareFootage and Price Fields'));
          }
           else 
           cond = Database.query(searchquery);
           return null;
   }

Public Pagereference addtolead() {
Id UnitId;

  Unitnamevf = System.currentPageReference().getParameters().get('UnitNameParam');
  LeadRecordId = ApexPages.CurrentPage().getparameters().get('id');

 List<Lead> Lds = new List<Lead>([select Id,Unit__c from Lead where Id= :LeadRecordId]);
 List<Condo__c> Cnd = New List<Condo__c>([select Id,Name from Condo__c where Name= :Unitnamevf]);
       if(!Cnd.isEmpty()){
        UnitId = Cnd[0].Id; 
        Lds[0].Unit__c = UnitId; 
          update Lds[0];
            }
            
    refreshPage=true;  
    return null;
    }


public void Reset(){ 

    beds = null;
    SFminimum = null;
    SFmaximum = null;
    ILPminimum = null;
    ILPmaximum = null;
    if(Cond != null) {
    Cond.clear();
 }
   }
  
 }
When i try to search with 1000000 and 1500000 in Price Min and Max fields.the soql query is executing fine.but when i enter the values seperated with commas like SFmin=10,00,000 and SFmax=15,00,000.then i am getting error like
"System.QueryException: unexpected token: ,"User-added image
I have created a Searchpage using Visualforce. Now i want to add one of the selected record from that page to a Lead. How to achieve this Scenario.
I am getting the records on visualforce page from Custom object Condo__c. The displayed records have a value called Name. i want to get the name value and update it to a Lookup field "Unit" in Lead Object.
User-added image
above is the screenshot of the search page. i have some filters on it to >display data. now i want to select one record from the list through checkbox >and when user clicks on "select" the "Unit Name" value in the record should be >updates to Unit lookup Field in Lead.Note: I am displaying this page as Inline >Visualforce Page in the Lead Detail page layout.
HI i want to create a search page in below format. Kindly help me in writing the soql query in controller when user enters the Values for Min and Max fields for Square Footage.
Visualforce Search page

Below is the Visual force page code.
<apex:page Standardcontroller="Opportunity" extensions="Condosearchcontroller" showHeader="true"> 
<style type="text/css">
        body {background: #F3F3EC; padding-top: 5px}
    </style>
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton value="Find Units" action="{!search}"/>  
               <apex:commandButton value="Reset" action="{!Clear}"/>
               <apex:commandButton action="{!cancel}" value="Cancel" immediate="true" html-formnovalidate="formnovalidate" />
               </apex:pageBlockButtons>
               <apex:pageBlockSection columns="2" collapsible="false">
                     <apex:inputText value="{!beds}"  label="Beds" />
                     <apex:inputText value="{!SFminimum}"  label="Min" />
                     <apex:inputText value="{!SFmaximum}"  label="Max"/>
                     
           </apex:pageBlockSection>
           
           
           <apex:pageblockTable value="{!Cond}" var="a" id="table">  
         <apex:column >  
          <apex:outputlink value="https://cs19.salesforce.com/{!a.id}">{!a.Name}</apex:outputlink>  
           </apex:column>
         
         <apex:column value="{!a.Beds__c}"/>
         <apex:column value="{!a.Square_Footage__c}"/>
         <apex:column value="{!a.Initial_List_Price__c}"/> 
    </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>

below is the Apex Controller i have written.

public with sharing class Condosearchcontroller { 
   public Condosearchcontroller() {

    }

    public list <Condo__c> Cond {get;set;}  
    public string beds {get;set;} 
    public string squarefootage {get;set;}
    public string SFminimum {get;set;}
    public string SFmaximum {get;set;}
    public string InitialListPrice {get;set;} 
    public string ILPminimum {get;set;}
    public string ILPmaximum {get;set;}
    
    public Condosearchcontroller(ApexPages.StandardController controller) {  
   }  
   
   public void Search(){
   
   string searchquery= 'select name,Beds__c,Square_Footage__c,Initial_List_Price__c from Condo__c where name!=NULL';
         if (!beds.equals('')) 
              searchquery+= ' and Beds__c = '+beds+'';
          if(!SFminimum.equals('') && SFmaximum.equals(''))
              searchquery+= ' and Square_Footage__c >= '+SFminimum+' and Square_Footage__c <= '+SFmaximum+'';
      Cond= Database.query(searchquery);
          }
public void clear(){  
   Cond.clear();  
   }  
 }
public with sharing class Condosearchcontroller { 
   public Condosearchcontroller() {

    }

    public list <Condo__c> Cond {get;set;}  
    public string beds {get;set;} 
    public string baths {get;set;}
    public string squarefootage {get;set;} 
    public Condosearchcontroller(ApexPages.StandardController controller) {  
   }  
   
   public void Search(){
   
   
   string searchquery= 'select name,Beds__c,Baths__c,Square_Footage__c,Initial_List_Price__c from Condo__c where name!=NULL';
         if (!beds.equals(''))
              searchquery+= ' and Beds__c = '+beds+'';
         if (!baths.equals(''))
              searchquery+=  ' and Baths__c = '+baths+'';
         if (!squarefootage.equals(''))
      searchquery+=  ' and Square_Footage__c = '+squarefootage+'';
      
      Cond= Database.query(searchquery);
      //return Cond;
    }
 
I have written a Controller for searching data on visualforce page. below is the controller.
public with sharing class Condosearchcontroller { 
   public Condosearchcontroller() {

    }

    public list <Condo__c> Cond {get;set;}  
    public string beds {get;set;} 
    public string baths {get;set;}
    public string squarefootage {get;set;} 
    public Condosearchcontroller(ApexPages.StandardController controller) {  
   }  
   
   public void search(){
   if (squarefootage == null){
    string searchquery='select name,Beds__c,Baths__c,Square_Footage__c from Condo__c where Beds__c = '+beds+' and Baths__c = '+baths+''; 
        Cond = Database.query(searchquery);
      }
      else { 
      string searchquery1='select name,Beds__c,Baths__c,Square_Footage__c from Condo__c where Beds__c = '+beds+' and Baths__c = '+baths+'and Square_Footage__c = '+squarefootage+'';
      Cond = Database.query(searchquery1);
}
}

when i enter data in all the 3 fields beds,baths,square footage. i am getting results.
but when i enter only beds,baths in visual force page.then i am getting error.
In the contact object i have a related list "Intralink Portal group" each contact can have multiple Intralink Porta groups. i have created a visual force page to add more than one intralink portal groups to a contact.now i want to select the Intralink Portal groups from one contact and add all of them to a new contact.how to do it? below is the visualforce page code and controller code.through controller i am able to add intralink portal groups to contact.but i am not able to copy all the list of intralink portal groups from one contact to another. below is the vf pageUser-added image
<apex:page Controller="ilGroupCtrl" doctype="html-5.0">
<apex:form >
    <apex:pageBlock title="Add Intralinks Groups">
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save"/>
            <apex:commandButton action="{!Cancel}" value="Cancel"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection columns="1" id="main">
            <apex:inputField value="{!mainGroupLinker.Contact__c}" />

            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Copy From" />
                <apex:inputField value="{!copyFrom.Contact__c}" required="false"/>
            </apex:pageBlockSectionItem>

            <apex:repeat value="{!groupList}" var="groupObj">
                <apex:pageBlockSectionItem >
                <apex:outputLabel value="Intralinks Group" />
                <apex:inputField value="{!groupObj.Intralinks_Portal_Group__c}" required="false"/>
            </apex:pageBlockSectionItem>
            </apex:repeat>
            <apex:commandButton action="{!add}" value="Add" rerender="main"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>

Apex Controller
 
public class ilGroupCtrl {

Map<String, String> params;

public Intralinks_Group_and_Contact_Links__c mainGroupLinker { get; set; }
public Intralinks_Group_and_Contact_Links__c copyFrom { get; set; }
public List<Intralinks_Group_and_Contact_Links__c> groupList { get; set; }

public ilGroupCtrl() {
    params = ApexPages.currentPage().getParameters();
    mainGroupLinker = new Intralinks_Group_and_Contact_Links__c();
    copyFrom = new Intralinks_Group_and_Contact_Links__c();
    groupList = new List<Intralinks_Group_and_Contact_Links__c>();

    // if QueryString contains a contact Id, autofill the Contact field
    if(params.containsKey('cid')) {
        mainGroupLinker.Contact__c = params.get('cid');
    }

    groupList.add(mainGroupLinker);
}

public void add() {
    groupList.add(new Intralinks_Group_and_Contact_Links__c(Contact__c=mainGroupLinker.Contact__c));
    return;
}

public PageReference save() {
    List<Intralinks_Group_and_Contact_Links__c> toAdd = new List<Intralinks_Group_and_Contact_Links__c>();

    //query all the Groups the copyFrom contact has
    if(copyFrom.Contact__c != null) {
       List<Intralinks_Group_and_Contact_Links__c> toCopy = [SELECT Intralinks_Portal_Group__c FROM Intralinks_Group_and_Contact_Links__c where Contact__c = :copyFrom.Contact__c];

        for(Intralinks_Group_and_Contact_Links__c copyGroup : toCopy) {
            Intralinks_Group_and_Contact_Links__c newCopy = new Intralinks_Group_and_Contact_Links__c(Contact__c= mainGroupLinker.Contact__c,Intralinks_Portal_Group__c= copyGroup.Intralinks_Portal_Group__c);


        }

   }

    for (Intralinks_Group_and_Contact_Links__c g : groupList) {
        // save it if it's not null.
        if(g.Intralinks_Portal_Group__c != null) {
            toAdd.add(g);

        }
    }

    System.debug('toAdd count: ' + toAdd.size());
    if(toAdd.size() > 0) {

        insert toAdd;
    }

    return null;
}

  Public Pagereference Cancel(){
   Pagereference Page = new         PageReference(ApexPages.currentPage().getParameters().get('https://cs16.salesforce.com/{!mainGroupLinker.Contact__c}'));  
 return Page;
      }
   }

 
I have a formula where i need to substitute forward slash "\" with double forward slash "\\".below is the formula 

HYPERLINK("file:///"&SUBSTITUTE(SUBSTITUTE(Project_Files_Path__c," ","%20"),"\","\\"),Project_Files_Path__c)

when i check the syntax i am getting below error

User-added image
kindly let me know any suggestions to resolve the issue?
User-added image
I want to display the text Resdential for Sale,Resdential for Rent,Hotel,Retail,Office and Parking in the first row which are only Labels.
i have written below visualforce code
<apex:page standardController="Development_Project__c">
<apex:form >


            <apex:pageBlockSection columns="1">
               <apex:pageBlockTable value="{!Development_Project__c}" var="dp" columnsWidth="10%,5%,5%,5%,5%,5%,5%">
                   <apex:column>
                         <apex:facet name="header">
                       </apex:facet>
                    </apex:column>

                   <apex:column  headerValue="#Units">
                       <apex:inputfield value="{!Development_Project__c.Residential_for_Sale_Total_Unit_Size__c}"/>
                   </apex:column>
                   <apex:column  headervalue="GSF">
                       <apex:inputField value="{!Development_Project__c.Residential_for_Sale_Total_Gross_sf__c}"/>
                   </apex:column>
                   <apex:column  headervalue="NSF">
                       <apex:inputField value="{!Development_Project__c.Residential_for_Sale_Total_Net_sf__c}"/>
                   </apex:column>
                   <apex:column  headervalue="EFF%" />
                   <apex:column  headervalue="AVG Unit" />
                   <apex:column  headervalue="F to F Height" />


            </apex:pageBlockTable>

        </apex:pageBlockSection>

    </apex:form>
  </apex:page>
with the above code i am able to achieve the below table 
User-added image
 
I have two lists(mainGroupLinkerIPGlist and toCopy) i am trying to remove all the values of mainGroupLinkerIPGlist from toCopy by creating a set and adding both the lists to the IPGset. below is the apex code.
 
List<Intralinks_Group_and_Contact_Links__c> mainGroupLinkerIPGlist = [SELECT Id,Intralinks_Portal_Group__c FROM Intralinks_Group_and_Contact_Links__c where Contact__c = :mainGroupLinker.Contact__c];
        //system.debug('mainGroupLinkerIPGlist =' + mainGroupLinkerIPGlist.size());

    //query all the Groups the copyFrom contact has
    if(copyFrom.Contact__c != null) {
       List<Intralinks_Group_and_Contact_Links__c> toCopy = [SELECT Id,Intralinks_Portal_Group__c FROM Intralinks_Group_and_Contact_Links__c where Contact__c = :copyFrom.Contact__c];

         system.debug('toCopy =' + toCopy.size());

         set<Intralinks_Group_and_Contact_Links__c> IPGset = New set<Intralinks_Group_and_Contact_Links__c>(toCopy);

         boolean result = IPGset.removeall(mainGroupLinkerIPGlist);
         System.assertEquals(true, result);
         system.debug('mainGroupLinkerIPGlist Count=' + mainGroupLinkerIPGlist.size());
         system.debug('IPGset count=' + IPGset.size());

when i am trying to remove all the mainGroupLinkerIPGlist values from set it is not removing and i am getting below message. System.AssertException: Assertion Failed: Expected: true, Actual: false