• Anil kumar Gorantala
  • NEWBIE
  • 164 Points
  • Member since 2015
  • Epam Systems, Inc.


  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 2
    Questions
  • 50
    Replies
Hi there,
is it possible to add an Filter like Industry to a visualforce Page ? Here is my code 

Hi there , 
is it possible to add a Filter to the visualfoce page below? :

<apex:page controller="LeadPageControllerKontaktiert" tabStyle="Leads">
    
     <apex:pageBlock title="Meine Leads">
        <apex:pageBlockSection title="20 - kontaktiert" columns="1">
           
     
            <apex:pageBlockTable value="{!leads}" var="l" columnsWidth="60%, 20%, 20%">
                //columnsWidth="400px, 100px, 400px, 200px, 200px, 50px"                            
                <apex:column >
                                                               
                    <apex:facet name="header">Name</apex:facet>
                                                
                    <apex:outputLink value="/{!l.Id}" target="_blank">
                        <apex:outputField value="{!l.company}"/>
                    </apex:outputLink> 
                </apex:column>
 
                <apex:column value="{!l.Status}" />
                                    
                <apex:column value="{!l.Lead_Score__c}" />     
                       
                
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>


Controller: 

public class LeadPageControllerKontaktiert {

    public List<Lead> getLeads() {       
        return [SELECT Id, Name, Company, Owner.name , Status, Lead_Score__c from Lead WHERE OwnerId = :UserInfo.getUserId() 
        AND Status = '20 - kontaktiert' AND LastModifiedDate != TODAY
        ORDER BY Lead_Score__c DESC 
        
        LIMIT 10
        ];
    }
}

Thanks for your help guys ! ;) 
Hello,

While updating records using data loader, do the triggers execute ?

If not, what are other ways of updating records where i can make sure that the triggers execute.

Thank you for suggestions
  • June 27, 2016
  • Like
  • 1
Can someone help me with how to close out this page? 
I am very new to VF and APEX and don't have a clue what I am doing wrong. 
Thanks! 

<apex:page>
<apex:page: standardcontroller="School__c" tabstyle="School__c">
    <style >
        p {
        font-size:16px;
        }
        .beenWorkingOut {
        font-size:16px;
        }
        .paraCrunch {
        margin-left:10%;
        margin-right:10%;
        }
        a {
        text-decoration:none;
        }
    </style>  
    
    
    <apex:pageBlock title="MealViewer Initial Call to Customer Checklist">
        
        <apex:pageBlockSection title="Summary" columns="2">
            
            <apex:outputField value="{!school.Phone}"/>
            <apex:outputField value="{!school.Name}"/>
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:outputLink onClick="window.open('/{!school.id}')">(View School)</apex:outputLink>
        </apex:pageBlockSection>        
        
        
    </apex:pageBlock>
    
    <apex:form >
        <span style="float:right">        
            
            <apex:commandButton action="{!save}" value="Save" /> &nbsp;
            <apex:commandLink onclick="return confirm('Are you sure you want to cancel? All changes will be lost!');" action="{!cancel}" value="cancel"/>
        </span>
        <br /><br /><br />
        <span style="float:right; font-size:12px; color:grey;">version 1.0 - revised 2015.04.07</span>
        <apex:pageBlock title="Details">
            <apex:pageBlockSection title="Introduction" columns="2">
                <p class="paraCrunch">
                    My name is <b>{!$User.FirstName} {!$User.LastName}</b> and I'm going to be taking care of you as your Onboarding Specialist here at MealViewer! Do you have a few minutes?
                </p>
                <p class="paraCrunch">
                    <ul class="beenWorkingOut">
                        <li>Call Summary</li>
                        <ul>
                            <li><a id="one1" href="#" style="color:black;" onclick="setColorById('one1','green');return false;">Ask the Questions</a></li>
                            <li><a id="one2" href="#" style="color:black;" onclick="setColorById('one2','green');return false;">Complete the Form</a></li>
                            <li><a id="one3" href="#" style="color:black;" onclick="setColorById('one3','green');return false;">Thank the Customer</a></li>
                        </ul>
                </ul>
            </p>
        </apex:pageBlockSection>
        <apex:pageBlockSection title="School Details" columns="2">
            <p class="paraCrunch">
                <ul class="beenWorkingOut">
                    <li><a id="two1" href="#" style="color:black;" onclick="setColorById('two1','green');return false;">Review All Account Details</a></li>
                    <li><a id="two2" href="#" style="color:black;" onclick="setColorById('two2','green');return false;">Verify Current Listed Contacts</a></li>
                    
                    
            </ul>
        </p>
        
       
        
        
        <apex:pageBlockSectionItem />
        <apex:inputField value="{!school.How_Many_Total_Wired_Players__c}"/>
        <apex:inputField value="{!school.How_Many_Total_Wireless_Players__c}"/>
        <apex:inputField value="{!school.How_Many_Total_Displays__c}"/>
        <apex:inputField value="{!school.How_Many_Additional_Digital_Suites__c}"/>
        <apex:inputField value="{!school.How_Many_Total_Mounts__c}"/>
        <apex:inputField value="{!school.How_Many_Total_Splitters__c}"/>
        <apex:inputField value="{!school.Length_between_Displays_for_splitters__c}"/>
        <apex:inputField value="{!school.Location_of_Player_in_School__c}"/>
        <apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
        <apex:inputField value="{!school.Menu_Planning_Software_Currently_Used__c}"/>
        <apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
        <apex:inputField value="{!school.Do_They_Have_Different_Serving_Lines__c}"/>
        <apex:inputField value="{!school.Serving_Lines_per_Player__c}"/>
        <apex:inputField value="{!school.Serving_Line_Name_s__c}"/>
        <apex:inputField value="{!school.Cycle__c}"/>
        <apex:inputField value="{!school.Cycle_Week__c}"/>
        <apex:inputField value="{!school.Customer_Confirmed_Installation_Date__c}"/>
        <apex:inputField value="{!school.Desired_Launch_Date__c}"/>
        <apex:inputField value="{!school.Installation_Date_Time__c}"/>
        <apex:inputField value="{!school.Installation_Area_Type__c}"/>
        <apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
        <apex:inputField value="{!school.Display_Size__c}"/>
    </apex:pageBlockSection>    
    
    <apex:pageBlockSection title="Contact Information" columns="1">
        <p class="paraCrunch">
            <ul class="beenWorkingOut">
    <apex:inputField value="{!school.Maintenance_Contact__c}"/>
    <apex:inputField value="{!school.IT_Contact__c}"/>
      
    </ul>
</p>

</apex:pageBlockSection>    
<apex:pageBlockSection title="Wrap-Up" columns="1">
    <p class="paraCrunch">
        Thank you so much for taking the time to meet with me today.  We are so excited to get started and look forward to working with you.  Are there any questions about the program that you have for me at this time?
    </p>
    <p class="paraCrunch">
        Again, my name is <b>{!$User.FirstName}</b>, and if you have any questions, please contact me at <b>803-380-5538</b>. Or, you can email me at <b>{!$User.Email}</b>.
    </p>    
</apex:pageBlockSection>    
</apex:pageBlock>
<span style="float:right">
    <apex:commandButton action="{!save}" value="Save" /> &nbsp;
    <apex:commandLink onclick="return confirm('Are you sure you want to cancel? All changes will be lost!');" action="{!cancel}" value="cancel"/>
</span><br /><br />

<apex:page> 
Hi all, 

I am a beginner developer (really an admin but learning to build VF pages)
I built a page for the Account Object that I now need to move to a Custom Object and reference the Custom Object (School__C) fields. 
I cloned the Account page I built and changed out the Account wth School...I must be doing something wrong because I get the error 
"School Does Not Exist"
Can someone help? 
Code below

<apex:page tabStyle="School__c" standardController="School">
    <style >
        p {
        font-size:16px;
        }
        .beenWorkingOut {
        font-size:16px;
        }
        .paraCrunch {
        margin-left:10%;
        margin-right:10%;
        }
        a {
        text-decoration:none;
        }
    </style>  
    
    
    <apex:pageBlock title="MealViewer Initial Call to Customer Checklist">
        
        <apex:pageBlockSection title="Summary" columns="2">
            
            <apex:outputField value="{!School.Phone}"/>
            <apex:outputField value="{!School.Name}"/>
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem />
            <apex:outputLink onClick="window.open('/{!school.id}')">(View School)</apex:outputLink>
        </apex:pageBlockSection>        
        
        
    </apex:pageBlock>
    
    <apex:form >
        <span style="float:right">        
            
            <apex:commandButton action="{!save}" value="Save" /> &nbsp;
            <apex:commandLink onclick="return confirm('Are you sure you want to cancel? All changes will be lost!');" action="{!cancel}" value="cancel"/>
        </span>
        <br /><br /><br />
        <span style="float:right; font-size:12px; color:grey;">version 1.0 - revised 2015.04.07</span>
        <apex:pageBlock title="Details">
            <apex:pageBlockSection title="Introduction" columns="2">
                <p class="paraCrunch">
                    My name is <b>{!$User.FirstName} {!$User.LastName}</b> and I'm going to be taking care of you as your Onboarding Specialist here at MealViewer! Do you have a few minutes?
                </p>
                <p class="paraCrunch">
                    <ul class="beenWorkingOut">
                        <li>Call Summary</li>
                        <ul>
                            <li><a id="one1" href="#" style="color:black;" onclick="setColorById('one1','green');return false;">Ask the Questions</a></li>
                            <li><a id="one2" href="#" style="color:black;" onclick="setColorById('one2','green');return false;">Complete the Form</a></li>
                            <li><a id="one3" href="#" style="color:black;" onclick="setColorById('one3','green');return false;">Thank the Customer</a></li>
                        </ul>
                </ul>
            </p>
        </apex:pageBlockSection>
        <apex:pageBlockSection title="School Details" columns="2">
            <p class="paraCrunch">
                <ul class="beenWorkingOut">
                    <li><a id="two1" href="#" style="color:black;" onclick="setColorById('two1','green');return false;">Review All Account Details</a></li>
                    <li><a id="two2" href="#" style="color:black;" onclick="setColorById('two2','green');return false;">Verify Current Listed Contacts</a></li>
                    
                    
            </ul>
        </p>
        
       
        
        
        <apex:pageBlockSectionItem />
        <apex:inputField value="{!school.How_Many_Total_Wired_Players__c}"/>
        <apex:inputField value="{!school.How_Many_Total_Wireless_Players__c}"/>
        <apex:inputField value="{!school.How_Many_Total_Displays__c}"/>
        <apex:inputField value="{!school.How_Many_Additional_Digital_Suites__c}"/>
        <apex:inputField value="{!school.How_Many_Total_Mounts__c}"/>
        <apex:inputField value="{!school.How_Many_Total_Splitters__c}"/>
        <apex:inputField value="{!school.Length_between_Displays_for_splitters__c}"/>
        <apex:inputField value="{!school.Location_of_Player_in_School__c}"/>
        <apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
        <apex:inputField value="{!school.Menu_Planning_Software_Currently_Used__c}"/>
        <apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
        <apex:inputField value="{!school.Do_They_Have_Different_Serving_Lines__c}"/>
        <apex:inputField value="{!school.Serving_Lines_per_Player__c}"/>
        <apex:inputField value="{!school.Serving_Line_Name_s__c}"/>
        <apex:inputField value="{!school.Cycle__c}"/>
        <apex:inputField value="{!school.Cycle_Week__c}"/>
        <apex:inputField value="{!school.Customer_Confirmed_Installation_Date__c}"/>
        <apex:inputField value="{!school.Desired_Launch_Date__c}"/>
        <apex:inputField value="{!school.Installation_Date_Time__c}"/>
        <apex:inputField value="{!school.Installation_Area_Type__c}"/>
        <apex:inputField value="{!school.Make_Model_Retrofitted_Displays__c}"/>
        <apex:inputField value="{!school.Display_Size__c}"/>
    </apex:pageBlockSection>    
    
    <apex:pageBlockSection title="Contact Information" columns="1">
        <p class="paraCrunch">
            <ul class="beenWorkingOut">
    <apex:inputField value="{!school.Maintenance_Contact__c}"/>
    <apex:inputField value="{!school.IT_Contact__c}"/>
      
    </ul>
</p>

</apex:pageBlockSection>    
<apex:pageBlockSection title="Wrap-Up" columns="1">
    <p class="paraCrunch">
        Thank you so much for taking the time to meet with me today.  We are so excited to get started and look forward to working with you.  Are there any questions about the program that you have for me at this time?
    </p>
    <p class="paraCrunch">
        Again, my name is <b>{!$User.FirstName}</b>, and if you have any questions, please contact me at <b>803-380-5538</b>. Or, you can email me at <b>{!$User.Email}</b>.
    </p>    
</apex:pageBlockSection>    
</apex:pageBlock>
<span style="float:right">
    <apex:commandButton action="{!save}" value="Save" /> &nbsp;
    <apex:commandLink onclick="return confirm('Are you sure you want to cancel? All changes will be lost!');" action="{!cancel}" value="cancel"/>
</span><br /><br />

</apex:form>
<br />



<script type="text/javascript">
function confirmCancel() {
    return confirm('Are you sure you want to cancel? All changes will be lost!');
}
function addressCopy(b0, b1, b2, b3, s0, s1, s2, s3) {
    // Copy billing fields to shipping fields
    document.getElementById(s0).value = document.getElementById(b0).value;
    document.getElementById(s1).value = document.getElementById(b1).value;
    document.getElementById(s2).value = document.getElementById(b2).value;
    document.getElementById(s3).value = document.getElementById(b3).value;
    // No form submission
    return false;
}
function setColorById(id,sColor) {
    var elem;
    if (document.getElementById) {
        if (elem=document.getElementById(id)) {
            if (elem.style) {
                elem.style.color=sColor;
                return 1;  // success
            }
        }
    }
    return 0;  // failure
}
</script>

</apex:page>
I want know how to get indexes of checkboxes and remove them from list at a time but not by iterating. How to do this? plz someone help me...
Here are my apex class and vf page:
Class:
public class DeletingCheckedRowsController {
        public List<WrapperClass> listWrapper {get;set;}
        public list<integer> temp{get;set;}
        public Boolean allchecked {get;set;}
        public DeletingCheckedRowsController() {
            listWrapper = new List<WrapperClass>();
            List<contact> contactList = [SELECT Id, firstName, lastname, Email, Phone FROM contact];
            if(contactList.size() > 0) {
                for(contact con : contactList) {
                    listWrapper.add(new WrapperClass(con));
                }
            }
        }
        
        public class WrapperClass {
            public Boolean checked {get;set;}
            public contact con {get;set;}
            public WrapperClass(contact con) {
                this.con = con;
            }
        }
        
        public void del() {
            integer count=0;
            temp=new list<integer>();
            List<contact> listconForDel = new List<contact>();
            List<WrapperClass> listTempWrapper = new List<WrapperClass>();
            for(WrapperClass w : listWrapper) {
                count++;
                if(w.checked) {
                    if(w.con.id==null)
                    {
                       temp.add(count-1);
                    }
                    else
                    listconForDel.add(w.con);
                }
                else {
                    listTempWrapper.add(w);
                }
            }
            
            if(temp.size()>0){
                for(integer i=temp.size();i>0;i--)
                {
                    listWrapper.remove(temp[i-1]);
                }
            }
            
            if(listconForDel.size() > 0) {
                delete listconForDel;
                listWrapper = listTempWrapper;
            }
        }
        
        public void selectAll() {
            if(allchecked) {
                for(WrapperClass w : listWrapper) {
                    w.checked = true;
                }
            } else {
                for(WrapperClass w : listWrapper) {
                    w.checked = false;
                }
            }
        }
        
        public void AddRow()
        {
            contact c = new contact();
            listWrapper.add(new WrapperClass(c));
        }
        
        public void insertnewrows()
        {
            list<contact> conts=new list<contact>();
            for(wrapperclass wrap:listwrapper){
                if(wrap.checked)
                conts.add(wrap.con);
            }
            upsert conts;
        }
    }


vf page:
<apex:page controller="DeletingCheckedRowsController">
<apex:pagemessages />
    <apex:form >
        <apex:pageBlock id="pb">
           <apex:pageBlockTable value="{!listWrapper}" var="w" id="pbt">
               <apex:column > 
                   <apex:facet name="header">
                       <apex:inputCheckbox value="{!allchecked}">
                           <apex:actionSupport reRender="pb" action="{!selectAll}" event="onchange"/>
                       </apex:inputCheckbox>
                   </apex:facet>
                   <apex:inputCheckbox value="{!w.checked}"/>
               </apex:column>
               <apex:column headerValue="Contact First Name">
                    <apex:inputfield value="{!w.con.firstName}"/>
                </apex:column>
                <apex:column headerValue="Contact Last Name">
                    <apex:inputfield value="{!w.con.lastName}"/>
                </apex:column>
               <apex:column headerValue="Contact Email">
                    <apex:inputfield value="{!w.con.email}"/>
                </apex:column>
               <apex:column headerValue="Contact Phone Number">
                    <apex:inputfield value="{!w.con.phone}"/>
                </apex:column>
            </apex:pageBlockTable> 
            <br/><apex:commandLink value="Add Row" action="{!Addrow}" reRender="pbt"/>
            <apex:pageBlockButtons >
                <apex:commandButton value="Save Selected rows" action="{!insertnewrows}" reRender="pbt"/>
                <apex:commandButton value="Delete Selected" action="{!del}" reRender="pbt"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
I want to email my wave analytics dashboard to an email. can we do that in wave analytics?
Hi All,
I have one requirement that i need to use mid() String function in Apex class.I have a set called zip and in that i am adding all the Account.Billingpostal code .for this i need to fetch only first 5 to return.I used like zip.add(String.mid(Account.BillingPostalCode, 1, 5));
But error i scoming as variable string doesnot exist.How to do this mid() and add it to the set called Zip with all account Postal code.

​Kindly help me on this  
 
public static void OnAfterInsert(List < Opportunity > newOpps) {
List<OpportunityTeamMember> opptList = new List<OpportunityTeamMember>();
for(Opportunity opp : newopps) {
    
    List<Account> acclist = [Select id, name, owner.division from account where id = :opp.account.id ];
    
    for (account a : acclist) {
        if (a.owner.division == 'Payback') {

            opportunityteammember opptm = new opportunityteammember(
            TeamMemberRole = 'Account Manager',
            OpportunityId = opp.id,
            UserId = opp.Ownerid);
            opptList.add(opptm);
            }    
            insert opptList;
        }
    }    
}  
Hi there,
is it possible to add an Filter like Industry to a visualforce Page ? Here is my code 

Hi there , 
is it possible to add a Filter to the visualfoce page below? :

<apex:page controller="LeadPageControllerKontaktiert" tabStyle="Leads">
    
     <apex:pageBlock title="Meine Leads">
        <apex:pageBlockSection title="20 - kontaktiert" columns="1">
           
     
            <apex:pageBlockTable value="{!leads}" var="l" columnsWidth="60%, 20%, 20%">
                //columnsWidth="400px, 100px, 400px, 200px, 200px, 50px"                            
                <apex:column >
                                                               
                    <apex:facet name="header">Name</apex:facet>
                                                
                    <apex:outputLink value="/{!l.Id}" target="_blank">
                        <apex:outputField value="{!l.company}"/>
                    </apex:outputLink> 
                </apex:column>
 
                <apex:column value="{!l.Status}" />
                                    
                <apex:column value="{!l.Lead_Score__c}" />     
                       
                
            </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>


Controller: 

public class LeadPageControllerKontaktiert {

    public List<Lead> getLeads() {       
        return [SELECT Id, Name, Company, Owner.name , Status, Lead_Score__c from Lead WHERE OwnerId = :UserInfo.getUserId() 
        AND Status = '20 - kontaktiert' AND LastModifiedDate != TODAY
        ORDER BY Lead_Score__c DESC 
        
        LIMIT 10
        ];
    }
}

Thanks for your help guys ! ;) 
Hi,

Can  any body tell me the difference betwen the getvalues() and getinstance () methods  customsettings.


Regards,
Siva.
Iam new to customization, I want to know In  which situation we can go with List,set and map.
 
Hello,

While updating records using data loader, do the triggers execute ?

If not, what are other ways of updating records where i can make sure that the triggers execute.

Thank you for suggestions
  • June 27, 2016
  • Like
  • 1
I want to get the Users which comes under the Roles, Roles & Subordinates and Public Groups of a Public group.
Is there any standard SObject from which we can query all users of a Public group OR I should write the complete logic of it. Please share your experience. 

Thanks
Kapil Kaushik
User-added image

I want to create a VF page where i have to create a picklist list value. the picklist options contains the short terms of the abbrevations and if i am selecting the one option then the fullform of that should be visible to the next textbox tab.

the fullform box should be only visible only after selecting the value in the picklist value and that should automatically change when i am selecting the different values .

I have a requirement to generate PDF for list of Object.

I have a button and on click of it this there are certain Records inserted and i have to display these inserted records in a PDF.

I have a controller that returns list of ids, now i want to display these on PDF.

For Ex:
 

acctlist = [SELECT id FROM Account WHERE Account.Country='INDIA'];
Lets say this acctlist has 10records and details of these should be displayed in PDF. Each record, new Page.

How do i accomplish this. I have a VF Page renderedas PDF i dont know how to proceed further.
I am trying to grab the picklist values from the State field on my Lead object. The State field is part of the Address date type. The following code returns nothing:
List<Schema.PicklistEntry>  fieldResult = Lead.State.getDescribe().getPicklistValues();
        system.debug('States = ' + fieldResult);
        
        Map<string,string> options = new Map<string,string>();
		for( Schema.PicklistEntry f : fieldResult )
   			{
      			options.put(f.getLabel(),f.getLabel());
                system.debug('State =' + f.getLabel());
   				}

 
When trying to set a value in picklist field using APEX for a custom object, we need to guarantee the same value disregarding the user current language when the record is saved.

Current code:
Custom_Object__c ojb = new Custom_Object__c();
ojb.Status__c = 'Liberado';

Org is working with 2 languages (Portuguese and English), where picklists are translated. Portuguese is default.

Issue: If we run as a user in English, the record is saved with the value 'Released' instead of 'Liberado'. That is, the value saved in the record is different depending on the user language, what is a big issue for the system logic.

Question: is this the standard behavior? How can we guarantee the same value using the APEX?
Hi,
Below is the Schedule Class with Test Class:

Schedule Class:

global class DailyLeadProcessor implements Schedulable {

    global void execute(SchedulableContext ctx) {
        List<Lead> lList = [Select Id, LeadSource from Lead where LeadSource = null limit 200];
        list<lead> led = new list<lead>();
        if(!lList.isEmpty()) {
            for(Lead l: lList) {
                l.LeadSource = 'Dreamforce';
                led.add(l);
            }
            update led;
        }
    }
}

Test Class:

@isTest
public class DailyLeadProcessorTest{

    static testMethod void testMethod1() 
    {
                Test.startTest();
        
        List<Lead> lstLead = new List<Lead>();
        for(Integer i=0 ;i <200;i++)
        {
            Lead led = new Lead();
            led.FirstName ='FirstName';
            led.LastName ='LastName'+i;
            led.Company ='demo'+i;
            lstLead.add(led);
        }
        
        insert lstLead;
        
        DailyLeadProcessor ab = new DailyLeadProcessor();
         String jobId = System.schedule('jobName','0 5 * * * ? ' ,ab) ;
        
   
        Test.stopTest();
    }
}
hai all 
on vfpage i have 4 inputcheckbox, if i selected checkbox 1 add to integer and then display the selected seat is 1 and if i selected checkbox 3 add to integer and then display the selected seat is 3  Iwant display the statically or dynamically
i wrote the code
it will count the noof seats
public class adds {
    public integer count{set;get;}
    public boolean book1{set;get;}
     public boolean book2{set;get;}
     public boolean book3{set;get;}
     public boolean book4{set;get;}
    public boolean book5{set;get;}
    public integer index{set;get;}
    public adds(){
      
        count=0;
    }
    public  void add1(){
        if(book1==true){
            count=count+1;
          index=1;
        }else if(book2==true){
            count=count+1;
            index=2;
        }else if(book3==true){
            count=count+1;
           
        }else if(book4==true){
            count=count+1;
        }else if(book5==true){
            count=count+1;
        }
    }
}
vfpage
<apex:page controller="adds" >
    <apex:form >
     <apex:pageblock id="one">
         <apex:inputCheckbox value="{!book1}">
             <apex:actionsupport event="onchange" action="{!add1}" rerender="one"/>
         </apex:inputCheckbox>&nbsp;&nbsp;
         <apex:inputCheckbox value="{!book2}"><apex:actionsupport event="onchange" action="{!add1}" rerender="one"/>
         </apex:inputCheckbox>&nbsp;&nbsp;
         <apex:inputCheckbox value="{!book3}"><apex:actionsupport event="onchange" action="{!add1}" rerender="one"/>
         </apex:inputCheckbox>&nbsp;&nbsp;&nbsp;
          <apex:inputCheckbox value="{!book4}"><apex:actionsupport event="onchange" action="{!add1}" rerender="one"/>
         </apex:inputCheckbox>&nbsp;&nbsp;
          <apex:inputCheckbox value="{!book5}"><apex:actionsupport event="onchange" action="{!add1}" rerender="one"/>
         </apex:inputCheckbox>&nbsp;&nbsp;
          
         {!count} selected seats{!index}
        </apex:pageblock>
    </apex:form>
</apex:page>

 
Hello All,
I have completed this challenge.

1-For this first you need to create a helper formula field(type-percent) 
Percent Completed :
(DATEVALUE( CreatedDate ) - CloseDate )/100


2- Then you need to create the actual formula field (type- text) by using the helper formula field.
Opportunity Progress :

IF( Percent_Completed__c <=25,"Early", 
IF(Percent_Completed__c <=75,"Middle", 
"Late"))

Thanks,
Nida



 

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.