• salesforcemicky125
  • NEWBIE
  • 5 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 14
    Replies
Hi Jeff,

Need your help .

I have written a  test class where i was unable to cover the code coverage for the Inner class.

I have a class which have 2 class in one class . when i have  written a test class i was unablk to cover the code coverage 1 class.

This is my controller :

global class JobSearch
{
    public String searchemail {get;set;}
    public string persearch{get;set;}
    public string jobDesc{get;set;}
    public List<Job__c> objJob{get;set;}
    public Job__c newjob{get;set;} 
    public List<List<Sobject>> objJobList{get;set;} 
    public JobSearch(ApexPages.StandardController controller)
    {
    List<Job__c> ObjJob= new List<Job__c>();
   
    List<List<Sobject>> objJobList = new List<List<Job__c>>(); 
     newjob = new Job__c();
    objJob=[Select Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c where Name like :searchemail limit 1];

    //objJobList = [FIND 'Name' IN ALL FIELDS RETURNING Job__c(Id,Name,Account__c,Industry__c,Job_Category__c,Career_Level__c)];
    }
  public PageReference search()
    {
     try
       {
   
    persearch = '%'+searchemail+'%';
   // objJob=[Select Id,Name,Account__c,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c from Job__c where Name like :persearch or Industry__c like :persearch or Account__r.Name like :persearch or CCL_Job_Type__c like :persearch or Job_Category__c like :persearch limit 10000];
    objJob=[Select Description__c,Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c where Name like :persearch or Industry__c like :persearch or Account__r.Name like :persearch or FSS_CCL__c like :persearch or Location__c like :persearch limit 10000];

     objJobList = [FIND 'Name'  IN ALL FIELDS RETURNING Job__c(Id,Name,Account__c,Industry__c,Job_Category__c,Career_Level__c)];   
   
   
    }
    catch(Exception ex){
          System.debug('\n\nException ='+ex.getMessage()+'\n\n');
          searchemail ='';

    

     }
    return null;
    }
   
   public String searchedRecordId { get; set; }
    public static list<ResultSet> searchedRecord {get;set;}   
    @RemoteAction
    global static ResultSet[] getRecords(String searchText) {
        //sObject List
        searchedRecord = new list<ResultSet>();
        //SOSL Text should be more then one charecter
        if(searchText.length() >0){
            //SOSL opretion to retrive records of the Account, Lead, Contact, Opportunity, Lead Objects you can add more.
            List<List<SObject>> searchList = [FIND :searchText IN ALL FIELDS RETURNING Job__c(Id,Name,Industry__c)];
            //Adding diffrent object's records in sobject list
            for(List<SObject> o:searchList){
                for(SObject s:o){
                    searchedRecord.add(new JobSearch.ResultSet(s));
                }
            }
        }

        return searchedRecord;
    }

      global class ResultSet{
        public String Id {get;set;}
        public String Name{get;set;}
        //public String Level__c{get;set;}
      // public String Description {get;set;}
       // public String sObjectName {get;set;}
        public ResultSet(sObject s){
            this.Id = s.Id;
            this.Name = s.get('Name')+'';
          //  this.Level__c=s.get('City__c')+'';
          //  this.Description = s.get('Description')+'';
            //this.sObjectName = getsObjectNameById(Id);           
        }      
        global ResultSet(String Id,String Name){
            this.Id = Id;
            this.Name = Name;
           //this.Level__c=City__c;
            //this.Description = Description;
            //this.Description__c= Description__c;
            //this.sObjectName = getsObjectNameById(Id);           
        }
 
    }   
   
           }


Test class

@isTest(SeeAllData=true)
private class TestJobSearch
{        
private static testMethod void TestJobSearch()
      {
         contact con=new contact(Lastname='A',Email='ryeturi@deloitte.com',FirstName='Srikanth',Phone='9620566619');
         insert con;
         List<Job__c> objJob = new List<Job__c>();
        objJob=[Select Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c limit 1];
   
      Asset assetObj = new Asset(Name = 'Test Asset');
      insert assetObj;
   
       ApexPages.StandardController sc = new ApexPages.StandardController(con);   
       JobSearch createCon = new JobSearch(sc);
             
       PageReference pageRef = Page.jobsearchrepeat;
       Test.setCurrentPage(pageRef);
                 
                   createCon.search();
    }
       }

The Class is fine worked for the Upper class ,but i cannot able to call the 2nd class which is in Bold letters.........
My code coverage is 47% only , can anyone help me out from this so that i can cover min 75% code coverage to move it to production
Hi ,

I was assigned to write a  Test class , where i was unable to cover the code coverage for the entire class i can able to pass the test class, but unable to cover the code coverage

Here is my Test class

@isTest(SeeAllData=true)
public class Test_CreateContactController
{

private static testMethod void TestCreateContactController()
  {
        
          Set<Id> sObjectIds = new Set<Id>(); 
          Set<id> sObjectrecIds = new Set<id>();
         set<id> campusrecid = new set<id>();
          List<id> acids = new List<id>();         
           List<RecordType> RecordTypeids = new List<RecordType>();        
         contact con=new contact();
         con.Lastname='Vishalg';
         con.Email='gaur@deloitte.com';
         con.FirstName='Gaur';
         con.Title='SiteDemo';
         con.Phone='7875434250';
        //con.recordtypeid=RecordTypeids[0].id;       
       // con.Recruiting_Event__c=objRecEvent.ID;    
        
         insert con;
        
           List<Event_Registration__c> ObjEvent = [Select id,Name,Contact__c,Recruiting_Event__c,Attended__c,Attending__c  from Event_Registration__c where id =:sObjectIds order by id limit 10]; 
            if (ObjEvent.size() > 0)
            {
           
             ObjEvent[0].Attended__C = true;
            ObjEvent[0].Attending__C = true;
             update ObjEvent;
            } 
           
            
              Recruiting_Event__c objRecEvent =  new Recruiting_Event__c();// [SELECT id,name,Location__c,Season__c,Account__c,Room__c,Status__c,Start_Date__c,End_Date__c FROM Recruiting_Event__c  limit 1];
               objRecEvent.name='Madhava Palla Event';
             objRecEvent.Season__c='Winter 2014';
              objRecEvent.Account__c='001R000000oYU5K';
              objRecEvent.Start_Date__c=system.today()-1;        
              objRecEvent.End_Date__c=system.today()+1;
               insert objRecEvent; 
             
               //List<Account> school = new List<Account>(); 
               //school=[Select id,Name from Account where id in :acids order by Name];  
              //insert school;
             
            List<Account> school = new List<Account>();
            //school.Name='001R000000oYU5K';
            //insert school;
                 


      ApexPages.StandardController sc = new ApexPages.StandardController(con);   
       CreateContactController createCon = new CreateContactController();  
           
       PageReference pageRef = Page.newregistration;
       Test.setCurrentPage(pageRef);
     
            
     createCon.displaySearchResults = true;
     createCon.selectedValue = '';
     createCon.schoolName ='';
     createCon.emailc ='';
     createCon.closePopup();
     createCon.getDisplaypblock();
    createCon.getschoollist();
    createCon.showPopup();
    createCon.cancel();
    createCon.getschoollist();     
    createCon.incrementCounter();
    createCon.displayPopUp = true;
      createCon.displaySearchResults = false;
     
     }

}

Here is the Class that i was to write the Test Class

public class CreateContactController
{
   public PageReference closePopup() {
        displayPopup = false;
        return null;
    }
    public boolean displayPopUp { get; set; }
    public PageReference showPopup() {
        displayPopup = true;
        return null;
    }
    public String getDisplaypblock() {
        return null;
    }
    public string schoolname{get;set;}
    public string emailc{get;set;}
    public Contact con{get; set;}
    public List<Contact> objContact {get;set;}
    public Event_Registration__c ObjEvent{get;set;}
    public List<Recruiting_Event__c> objRecEvent{get;set;}
    public Recruiting_Event__c ObjAccountRec{get;set;}
    public Boolean displaySearchResults{get;set;}
    public Recruiting_Event__c newrecevent{get;set;}
    public String selectedValue {get
    {
        if(selectedValue <> null && selectedValue <> '')
        {
            return selectedValue ;
        }
        else{
            selectedValue = '';
            return selectedValue ;
        }
    } set;}
    public List<id> acids = new List<id>();
    public List<Recruiting_Event__c> recevents= new List<Recruiting_Event__c>();
    public List<Account> school = new List<Account>();
    public List<Contact> user=new List<Contact>();
    public CreateContactController(ApexPages.StandardController controller) {
    newrecevent = new Recruiting_Event__c();
    this.newrecevent =(Recruiting_Event__c)controller.getRecord();
    con = new contact();
    }
    public PageReference Cancel() {
        return null;
    }
public String getschoollist() {
        return schoolname;
    }
    public CreateContactController()
    {
        con=new Contact ();
        ObjAccountRec = new Recruiting_Event__c();      

}
   public List<SelectOption> schoollist
    {
        get
        {   recevents= [Select Account__c,Name From Recruiting_Event__c];
            schoollist = new List<SelectOption>();
         for(Recruiting_Event__c temp : recevents)
            {  

                acids.add(temp.Account__c);
            }
         school=[Select id,Name from Account where id in :acids order by Name];  
         schoollist.add(new selectOption('--None--','--None--'));
         for(Account temp1: school)
         {
        schoollist.add(new SelectOption(temp1.Id,temp1.Name));
         }  
         system.debug('shcooltypename1'+schoolname);
        return schoollist;
                }
        set;
    }
public PageReference incrementCounter() {
        schoolname=getschoollist();
        displaySearchResults=true;
        date Next = system.today()+2;
        date cnow = system.today();
        date Last = system.today()-2;
        system.debug('systemNext'+Next);
        system.debug('systemLast'+Last);
        objContact=[SELECT id,name,email from contact where email=:con.Email limit 2];
        objRecEvent=[SELECT id,name,Location__c,Season__c,Account__c,Room__c,Status__c,Start_Date__c,End_Date__c FROM Recruiting_Event__c  WHERE Account__c =:selectedValue and Start_Date__c >=:Last and Start_Date__c <=:Next and Status__c<>'Completed'];     
        set<id> recids = new set<id>();
        set<id> campusrecid = new set<id>();
        List<RecordType> RecordTypeids = new List<RecordType>();
        RecordTypeids =[select id,name from RecordType where sobjecttype = 'Contact' and name='campus' limit 1];
        con.recordtypeid=RecordTypeids[0].id;
        con.Accountid=objRecEvent[0].Account__c;
        if(ObjContact.size()<=0){
        insert con;
        PageReference cr=new PageReference('https://eevent-deloittenet.cs2.force.com/event/newregistration_rec?cid='+con.id+'&acid='+objRecEvent[0].Account__c);
        cr.setRedirect(true);
        return cr;
        }      
        else
        {
        PageReference dr=new PageReference('https://eevent-deloittenet.cs2.force.com/event/newregistration_rec?cid='+objContact[0].id+'&acid='+objRecEvent[0].Account__c);
        dr.setRedirect(true);
        return dr;       
        }
       
       
    }
   
}
Hi,

I have a requirement .......

On Clicking a button using the CommanButton i need to refresh a PageBlock.

Apart from from PageBlock it is also rfershing the complete Page which should not happen.

Can any one help me out by looking into my code . Such that when i click on the Continue Button it has to refresh the Page Block such that on clicking the Continue button it will showcase the PageBlock which i am looking , but at the same time it is refreshing the  Page by which whatever the records that i selected will be get lost and user has to select the record once again. which should not happen.

Here is my code

<apex:page standardController="Recruiting_Event__c" extensions="MassEmailEventForCampus" id="pageid" sidebar="true" showHeader="true" tabStyle="Contact">

<style>
.mmSubheader {
background-color= #E2E3E5;
font size: 1em;
margin: 18px 0 7px;
padding: 4px 9px;
color: black;
font-weight:bold;
}
.label{
padding:3px;
color: #222222;font-family: Arial,Helvetica,sans-serif;
}
.he1 {

     font-weight: bold;
     -moz-user-select: text;
    font-family: 'Arial','Helvetica',sans-serif;
    font-size: 100%;
    line-height: normal;
    border-style: none solid none none;
    border-width: 0 1px 0 0;
    padding: 2px 0 3px;
    vertical-align: baseline;
     border-left-color: #EEEEEE;
    border-right-color: #D0D0D0;
    border-left: 1px solid;
    border-right: 1px solid;
    -moz-user-focus: normal;
    outline: medium none;
    text-align: left;
}
</style>
<script type="text/javascript">
document.getElementsByTagName("input").checked;
    function checkAll(cb,cbid)
        {
            var inputElem = document.getElementsByTagName("input");                   
            for(var i=0; i<inputElem.length; i++)
            {           
                 if(inputElem[i].id.indexOf(cbid)!=-1){                                      
                    inputElem[i].checked = cb.checked;
                }
            }
        }
</script>
<script language="javascript" type="text/javascript">
var pickListArray=[];
var campaignPickListArray=[];
function popUpLookUpWindow(url,col,val) {
      var colValue=document.getElementById(col).value;
      if(colValue!='None'){
      url=url+'&column='+colValue+'&val='+val;
    newwindow=window.open(url,'name','height=430,width=620,toolbar=no,resizable=yes,scrollbars=yes');
    if (window.focus) {newwindow.focus()}
    }
}
function closePopUp(){
   if (null!=newwindow)
    {
      newwindow.close();
    }
}
</script>
  <apex:form >
<apex:repeat value="{!pickListCol}" var="request">
        <script>
            pickListArray.push('{!request}');
        </script>
    </apex:repeat>
     <apex:repeat value="{!pickListCampaignCol}" var="list">
        <script>
            campaignPickListArray.push('{!list}');
        </script>
    </apex:repeat>
    <script>
   
function isPickList(selectedId,lookupId){

var val=document.getElementById(selectedId).value;
for (var i = 0; i < pickListArray.length; i++) {
// alert('pickListArray === ' + pickListArray[i]);
        if (pickListArray[i] ===val){
            document.getElementById(lookupId).style.display = "block";
            break;
            }else{
            document.getElementById(lookupId).style.display = "none";
            }
    }
}

function isCampaignPickList(selectedId,lookupId){
var val=document.getElementById(selectedId).value;
for (var i = 0; i < campaignPickListArray.length; i++) {
  // alert('campaignPickListArray=== ' + campaignPickListArray[i]);
        if (campaignPickListArray[i] ===val){
            document.getElementById(lookupId).style.display = "block";
            break;
            }else{
            document.getElementById(lookupId).style.display = "none";
            }
    }

}
  </script> <apex:sectionHeader subtitle="Mass Email"/>
<apex:pageBlock title="Step 1: Select email recipients">
<div class="mmSubheader">Select Event Name <apex:inputField value="{!eropty.Recruiting_Event__c}" id="crmcmpid">
  </apex:inputfield>
  
  <br></br>
  Attended <apex:inputField value="{!eropty.Attended__c}" id="crmcmpid1">
  </apex:inputfield>
  Attending <apex:inputField value="{!eropty.Attending__c}" id="crmcmpid2">
  </apex:inputfield>
Invited <apex:inputField value="{!eropty.Invited__c}" id="crmcmpid3">
  </apex:inputfield>
No Show <apex:inputField value="{!eropty.No_Show__c}" id="crmcmpid5">
  </apex:inputfield>
Not Attending <apex:inputField value="{!eropty.Not_Attending__c}" id="crmcmpid6">
  </apex:inputfield>
  No Response  <apex:inputCheckbox value="{!eropty.No_Response__c}" id="crmcmp1d7"/>

 
  <br></br>
 
 
 
 

</div> 

      <div class="mmSubheader" style="display:none">Choose Member Type to Search          </div>   
<div class="mmSubheader"></div>
 
    <apex:outputPanel id="criteria">
          <apex:actionstatus id="status" startText="Loading...">
             <apex:facet name="stop">
           
               <apex:outputPanel >
              
            
            <apex:commandButton action="{!go}" value="Search" reRender="searchProgress,results1,dTable" status="searchProgress" />
            <br/>
            <apex:actionStatus id="searchProgress">
                        <apex:facet name="start">
                            <table align="center" border="0">
                                <tr>
                                    <td style="vertical-align:middle;" align="center">
                                        <img src="{!$Resource.saveStatus}"/>
                                    </td>
                                </tr>
                            </table>
                        </apex:facet>
</apex:actionStatus>
              </apex:outputPanel>
         
            </apex:facet>
          </apex:actionstatus>
     </apex:outputPanel>
      <br/>
     <apex:pageBlockSection columns="1" >
     <script type="text/javascript">new MenuButton('MyMenu', false);</script>

    <apex:pageBlockTable id="dTable" value="{!contactList}" var="dat"  border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="4px" columnsWidth="60px,150px,150px,150px,170px" >
     <apex:column ><apex:facet name="header">
<apex:inputCheckbox onclick="checkAll(this,'checkedone')"/>
</apex:facet>
<apex:inputCheckbox value="{!dat.selected}" id="checkedone"/></apex:column>
   <apex:column headerValue="First Name"  ><apex:outputField value="{!dat.con.FirstName}" rendered="{!IF(ISBLANK(dat.con.FirstName), 'false', 'true')}"/>
   </apex:column>
     <apex:column headerValue="Last Name" ><apex:outputField value="{!dat.con.LastName}" rendered="{!IF(ISBLANK(dat.con.LastName), 'false', 'true')}"/> 
      </apex:column>
     <apex:column headerValue="Title" ><apex:outputField value="{!dat.con.Title}" rendered="{!IF(ISBLANK(dat.con.Title), 'false', 'true')}"/>
     </apex:column>
     <apex:column headerValue="Account Name" ><apex:outputField value="{!dat.con.AccountId}" rendered="{!IF(ISBLANK(dat.con.AccountId), 'false', 'true')}"/> </apex:column>
     <apex:column headerValue="Email"  ><apex:outputField value="{!dat.con.Email}" rendered="{!IF(ISBLANK(dat.con.Email), 'false', 'true')}"/>
     </apex:column>
          </apex:pageBlockTable>
          </apex:pageBlockSection>
    
     &nbsp; &nbsp; <apex:commandLink action="{!previousResults}" value="Previous" reRender="emailTemplateBlock"/> &nbsp; | &nbsp; <apex:commandLink action="{!nextResults}" value="Next" reRender="dTable" />
       
  
          
   <br></br><br></br>
</apex:pageBlock>
<apex:pageblock >
<apex:commandButton action="{!Save}" value="Continue..."/>
</apex:pageblock>

        <apex:pageBlock title="Step 2: Select an email template" id="emailTemplateBlock" rendered="{!displaypblock}">
                Select Email Template Folder:
            <apex:selectList value="{!selectedEmailTemplateFolder}" multiselect="false" size="1">
                <apex:selectOptions value="{!emailTemplateFolderOpts}" />
                <apex:actionSupport event="onchange" action="{!refreshEmailTemplateSection}" rerender="emailTemplateBlock" />
            </apex:selectList>
            <br/><br></br>
            Select Email Template:
            <apex:selectList value="{!selectedEmailTemplate}" multiselect="false" size="1" >
                <apex:selectOptions value="{!emailTemplateOpts}" />
<apex:actionSupport event="onchange" action="{!refreshEmailTemplateSectionid}" rerender="emailTemplateBlock" />               
                            </apex:selectList>
             <apex:outputLink target="_blank" value="{!emailTemplateId}">   Preview</apex:outputLink>            <br/><br></br>
                      
<apex:commandButton action="{!SendEmail}" value="Send Email" rendered="{!if(emailTemplateOpts.size > 0, true, false)}"/>
    </apex:pageBlock>  </apex:form>
</apex:page>

Regards
Micky
Hi ,

I have a visual force page  and an  controller .

We have a Button in my VF page called Continue ...>

when i click on this button i want to display below pageblock  " Select Email Template Folder " and " Select Email Template".

Currently i am viewing te VF Page with  pageblock  " Select Email Template Folder " and " Select Email Template" with out clicking the Contionue.

This my VF Page can any one help me out

<apex:page standardController="Event_Registration__c" extensions="MassEmailEvent" id="pageid" sidebar="true" showHeader="true" tabStyle="Contact">

<style>
.mmSubheader {
background-color= #E2E3E5;
font size: 1em;
margin: 18px 0 7px;
padding: 4px 9px;
color: black;
font-weight:bold;
}
.label{
padding:3px;
color: #222222;font-family: Arial,Helvetica,sans-serif;
}
.he1 {

     font-weight: bold;
     -moz-user-select: text;
    font-family: 'Arial','Helvetica',sans-serif;
    font-size: 100%;
    line-height: normal;
    border-style: none solid none none;
    border-width: 0 1px 0 0;
    padding: 2px 0 3px;
    vertical-align: baseline;
     border-left-color: #EEEEEE;
    border-right-color: #D0D0D0;
    border-left: 1px solid;
    border-right: 1px solid;
    -moz-user-focus: normal;
    outline: medium none;
    text-align: left;
}
</style>
<script type="text/javascript">
    function checkAll(cb,cbid)
        {
            var inputElem = document.getElementsByTagName("input");                   
            for(var i=0; i<inputElem.length; i++)
            {           
                 if(inputElem[i].id.indexOf(cbid)!=-1){                                      
                    inputElem[i].checked = cb.checked;
                }
            }
        }
</script>
<script language="javascript" type="text/javascript">
var pickListArray=[];
var campaignPickListArray=[];
function popUpLookUpWindow(url,col,val) {
      var colValue=document.getElementById(col).value;
      if(colValue!='None'){
      url=url+'&column='+colValue+'&val='+val;
    newwindow=window.open(url,'name','height=430,width=620,toolbar=no,resizable=yes,scrollbars=yes');
    if (window.focus) {newwindow.focus()}
    }
}
function closePopUp(){
   if (null!=newwindow)
    {
      newwindow.close();
    }
}
</script>
  <apex:form >
<apex:repeat value="{!pickListCol}" var="request">
        <script>
            pickListArray.push('{!request}');
        </script>
    </apex:repeat>
     <apex:repeat value="{!pickListCampaignCol}" var="list">
        <script>
            campaignPickListArray.push('{!list}');
        </script>
    </apex:repeat>
    <script>
   
function isPickList(selectedId,lookupId){

var val=document.getElementById(selectedId).value;
for (var i = 0; i < pickListArray.length; i++) {
// alert('pickListArray === ' + pickListArray[i]);
        if (pickListArray[i] ===val){
            document.getElementById(lookupId).style.display = "block";
            break;
            }else{
            document.getElementById(lookupId).style.display = "none";
            }
    }
}

function isCampaignPickList(selectedId,lookupId){
var val=document.getElementById(selectedId).value;
for (var i = 0; i < campaignPickListArray.length; i++) {
  // alert('campaignPickListArray=== ' + campaignPickListArray[i]);
        if (campaignPickListArray[i] ===val){
            document.getElementById(lookupId).style.display = "block";
            break;
            }else{
            document.getElementById(lookupId).style.display = "none";
            }
    }

}
  </script> <apex:sectionHeader subtitle="Mass Email"/>
<apex:pageBlock title="Step 1: Select email recipients">
<div class="mmSubheader">Select Event Name <apex:inputField value="{!eropty.Recruiting_Event__c}" id="crmcmpid">
  </apex:inputfield>
  
  <br></br>
  Attended <apex:inputField value="{!eropty.Attended__c}" id="crmcmpid1">
  </apex:inputfield>
  Attending <apex:inputField value="{!eropty.Attending__c}" id="crmcmpid2">
  </apex:inputfield>
Invited <apex:inputField value="{!eropty.Invited__c}" id="crmcmpid3">
  </apex:inputfield>
No Show <apex:inputField value="{!eropty.No_Show__c}" id="crmcmpid5">
  </apex:inputfield>
Not Attending <apex:inputField value="{!eropty.Not_Attending__c}" id="crmcmpid6">
  </apex:inputfield>
No Responce<apex:inputField value="{!eropty.Not_Attending__c}" id="crmcmpid7">
  </apex:inputfield>
 
  <br></br>
 
 
 
 

</div> 

      <div class="mmSubheader" style="display:none">Choose Member Type to Search          </div>   
<div class="mmSubheader"></div>
 
    <apex:outputPanel id="criteria">
          <apex:actionstatus id="status" startText="Loading...">
             <apex:facet name="stop">
           
               <apex:outputPanel >
              
            
            <apex:commandButton action="{!go}" value="Search" reRender="searchProgress,results1,dTable" status="searchProgress" />
            <br/>
            <apex:actionStatus id="searchProgress">
                        <apex:facet name="start">
                            <table align="center" border="0">
                                <tr>
                                    <td style="vertical-align:middle;" align="center">
                                        <img src="{!$Resource.saveStatus}"/>
                                    </td>
                                </tr>
                            </table>
                        </apex:facet>
</apex:actionStatus>
              </apex:outputPanel>
         
            </apex:facet>
          </apex:actionstatus>
     </apex:outputPanel>
      <br/>
     <apex:pageBlockSection columns="1" >
     <script type="text/javascript">new MenuButton('MyMenu', false);</script>

    <apex:pageBlockTable id="dTable" value="{!contactList}" var="dat"  border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="4px" columnsWidth="60px,150px,150px,150px,170px" >
     <apex:column ><apex:facet name="header">
<apex:inputCheckbox onclick="checkAll(this,'checkedone')"/>
</apex:facet>
<apex:inputCheckbox value="{!dat.selected}" id="checkedone"/></apex:column>
   <apex:column headerValue="First Name"  ><apex:outputField value="{!dat.con.FirstName}" rendered="{!IF(ISBLANK(dat.con.FirstName), 'false', 'true')}"/>
   </apex:column>
     <apex:column headerValue="Last Name" ><apex:outputField value="{!dat.con.LastName}" rendered="{!IF(ISBLANK(dat.con.LastName), 'false', 'true')}"/> 
      </apex:column>
     <apex:column headerValue="Title" ><apex:outputField value="{!dat.con.Title}" rendered="{!IF(ISBLANK(dat.con.Title), 'false', 'true')}"/>
     </apex:column>
     <apex:column headerValue="Account Name" ><apex:outputField value="{!dat.con.AccountId}" rendered="{!IF(ISBLANK(dat.con.AccountId), 'false', 'true')}"/> </apex:column>
     <apex:column headerValue="Email"  ><apex:outputField value="{!dat.con.Email}" rendered="{!IF(ISBLANK(dat.con.Email), 'false', 'true')}"/>
     </apex:column>
          </apex:pageBlockTable>
          </apex:pageBlockSection>
    
     &nbsp; &nbsp; <apex:commandLink action="{!previousResults}" value="Previous" reRender="emailTemplateBlock"/> &nbsp; | &nbsp; <apex:commandLink action="{!nextResults}" value="Next" reRender="dTable" />
       
   <br></br><br></br><apex:commandButton action="{!Save}" value="Continue..." disabled="emailTemplateBlock" onclick="emailTemplateBlock" reRender="displaypblock"/>
</apex:pageBlock>

        <apex:pageBlock title="Step 2: Select an email template" id="emailTemplateBlock" rendered="{!displaypblock}">
                Select Email Template Folder:
            <apex:selectList value="{!selectedEmailTemplateFolder}" multiselect="false" size="1">
                <apex:selectOptions value="{!emailTemplateFolderOpts}" />
                <apex:actionSupport event="onchange" action="{!refreshEmailTemplateSection}" rerender="emailTemplateBlock" />
            </apex:selectList>
            <br/><br></br>
            Select Email Template:
            <apex:selectList value="{!selectedEmailTemplate}" multiselect="false" size="1" >
                <apex:selectOptions value="{!emailTemplateOpts}" />
<apex:actionSupport event="onchange" action="{!refreshEmailTemplateSectionid}" rerender="emailTemplateBlock" />               
                            </apex:selectList>
             <apex:outputLink target="_blank" value="{!emailTemplateId}">Preview</apex:outputLink>            <br/><br></br>
                      
<apex:commandButton action="{!SendEmail}" value="Send Email" rendered="{!if(emailTemplateOpts.size > 0, true, false)}"/>
    </apex:pageBlock>  </apex:form>
</apex:page>



Hi ,

I have  stuck with the Validation Rules using the Java Script , Can anyone help me out from this.

I have implemeted the Validation rule for the Server Side , but i  have stuck with it in implemeting it in Java Script.

This is the Validation rule that i have implemented for Server Side for Multiple Stage and the same i want to implemet it in Client Side using the Java scripe

Here is the Server side Validation Rule 


OR
(
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR( ISPICKVAL(CRM_Stage__c,"Stage 3: National/CEO Interviews")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 4: Board Interviews")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 5: Board Package Finalization")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR( ISPICKVAL(CRM_Stage__c,"Stage 6: Package Review")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 7: Approved/Agreement Finalization")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 8: Provisioning/On-Boarding")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 9: On-Board")), CRM_Gender__c =""))


And here is my Java script cod efor Validation rule

else if(voptygender== "" && (voptystage == 'Stage 3: National/CEO Interviews'))
{
    alert("Race is a required for Stage 3: National/CEO Interviews");
  document.getElementById('{!$Component.formid.op.keyid.optyrace}').focus();
}

This is working for only one Stage , but when i have implemeted it for the Multiple Stages it is throwing error whe it is in blank stage that is fine , but when i have save it with without blank with Specified message it has to save it but still it is throwing error

Here is the Code that i have implented for the Multiple stages using  Java Script

else if(voptygender == "" && (voptystage == 'Stage 3: National/CEO Interviews') || (voptystage == 'Stage 4: Board Interviews') || (voptystage == 'Stage 5: Board Package Finalization') || (voptystage == 'Stage 6: Package Review') || ( voptystage == 'Stage 7: Approved/Agreement Finalization') || (voptystage == 'Stage 8: Provisioning/On-Boarding') || ( voptystage== 'Stage 9: On-Board'))
{
  alert("Gender is a required for Stage 3: National/CEO Interviews");
  document.getElementById('{!$Component.formid.op.keyid.optygender}').focus();
}

Can Anyone correct me  where exactly i gone wrong 


Reagrds
Micky
I Have a  requirement where i have to filter the Email Address which do not have email address i.e  Email Address is should be blank in the Contact Object.

When i want to send the Email to any one who have Valid email address in the Contact object by clicking on the Go button i will get list of contact records and in that i want to filter the contact reords whose Email Addreess field is Blank so that i can send the email record to the person who have email address field is a having valid email address , but it should not be Blank.

Some one help me out with the Sample Example on how to filter list of records where i don't want to see blank email fields from the list of Contact records have a  valid email adderess . So That i can send the Email to all the contact reords who have email address.

Thank you for responding very quickly,

Actually we are doing it b y custom code , where we will list of contact records with both Email Address and with the Blank email address.

So we don't want to see the Blank email address with the List of Contact  records which have the Valid Email address.



Here is code we have, this is the Method where we will using to get the list of contact records.

I think this may help you more simple what i am looking for


public Pagereference go() {
        errormsg = '';
        errormsg = errorString();
        String conditionstring = '';
        conditionstring = condString();
        String querystring = '';
        string crmcampname;
        crmcampname = opty.CRM_Campaign__C;
        Set<Id> sObjectIds = new Set<Id>();
        System.debug('--->crmcampname' + crmcampname);
        System.debug('--->Conitionstring' + conditionstring);
            List<CRM_Campaign__c> cmp = [Select Id from CRM_Campaign__c where Name =: 'Select Campaign'];
            String cmpid = cmp[0].Id;
           if (crmcampname <> cmpid && conditionstring <> '')
            {
             for(CRM_Campaign_Member__c crm: [Select id,crm_contact__c from CRM_Campaign_Member__c where CRM_Campaign__r.id =: crmcampname])
            {
            sObjectids.add(crm.CRM_Contact__c)  ;
            system.debug('sobjectadd');
            }
            querystring = 'Select AccountId, Email,Name,FirstName, Id, LastName, Title from Contact where id in:sObjectIds';
            querystring = querystring + ' and' + conditionstring + ' LIMIT 1000';//add conditions to the query by appending the conditonString
            System.debug('--->query--First Condition' + conditionstring);
            }
            else
            if ((crmcampname =='cmpid') && (conditionstring <> null && conditionstring <> ''))
            {
                        system.debug('sobjectadd');
            querystring = 'Select AccountId, Email,Name,FirstName, Id, LastName, Title from Contact';
            querystring = querystring + ' Where'+ conditionstring + ' LIMIT 1000';//add conditions to the query by appending the conditonString
            System.debug('--->query--Second Condition' + conditionstring);
            System.debug('--->query' + conditionstring);
            }
            else
            if ((conditionstring <> null && conditionstring == ''))
            {
                        for(CRM_Campaign_Member__c crm: [Select id,crm_contact__c from CRM_Campaign_Member__c where CRM_Campaign__r.id =: crmcampname])
            {
            sObjectids.add(crm.CRM_Contact__c)  ;
            }
              querystring = 'Select AccountId, Email,Name,FirstName, Id, LastName, Title from Contact where id in:sObjectIds';
               System.debug('--->query--Third Condition' + conditionstring);
            }
            else
            querystring = 'Select AccountId, Email,Name,FirstName, Id, LastName, Title from Contact';
          
       if (! (errormsg.contains('Column') || errormsg.contains('Operator')))
         {
            System.debug('The querystring is' + querystring);
            System.debug('crmcampname' + crmcampname);
            filerResult = Database.query(querystring);//execute the query
            sscResults = new ApexPages.StandardSetController(filerResult);
            sscResults.setPageSize(25);//set the page size for pagination
        }
         else
          {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, errormsg);
            ApexPages.addMessage(myMsg);
        }
           return null;
    }

Regards
Micky
Hi, Can anyone help me out on writing a test case for a custom controller Below is the Controller class public class CreateContactController { public PageReference redirectPopup() { try { emailc=con.Email; set recids = new set(); set campusrecid = new set(); List RecordTypeids = new List(); RecordTypeids =[select id,name from RecordType where sobjecttype = 'Contact' and name='campus' limit 1]; con.recordtypeid=RecordTypeids[0].id; insert con; con=new Contact (); objEvent= new Event_Registration__c (); objContact =[select id,name,FirstName,LastName,MobilePhone,Email from Contact where email= :emailc limit 1]; objEvent.Contact__c=ObjContact[0].id; system.debug('bugcontact'+ObjContact[0].id); ObjEvent.Recruiting_Event__c=objRecEvent[0].id; ObjEvent.Attended__c=True; insert objEvent; PageReference pr=new PageReference('/apex/eventRegistration/checkin'); pr.setRedirect(true); return pr; } catch(Exception e){ ApexPages.addMessages(e); return null; } } public PageReference closePopup() { displayPopup = false; return null; } public boolean displayPopUp { get; set; } public PageReference showPopup() { displayPopup = true; return null; } public String getDisplaypblock() { return null; } public string schoolname{get;set;} public string emailc{get;set;} public Contact con{get; set;} public List objContact {get;set;} public Event_Registration__c ObjEvent{get;set;} public List objRecEvent{get;set;} public Recruiting_Event__c ObjAccountRec{get;set;} public Boolean displaySearchResults{get;set;} public String selectedValue {get { if(selectedValue <> null && selectedValue <> '') { return selectedValue ; } else{ selectedValue = ''; return selectedValue ; } } set;} public List acids = new List(); public List recevents= new List(); public List school = new List(); public CreateContactController(ApexPages.StandardController controller) { emailc=con.Email; } public PageReference Cancel() { return null; } public String getschoollist() { return schoolname; } public CreateContactController() { con=new Contact (); ObjAccountRec = new Recruiting_Event__c(); } public List schoollist { get { recevents= [Select Account__c,Name From Recruiting_Event__c]; schoollist = new List(); for(Recruiting_Event__c temp : recevents) { acids.add(temp.Account__c); } school=[Select id,Name from Account where id in :acids]; for(Account temp1: school) { schoollist.add(new SelectOption(temp1.Id,temp1.Name)); } system.debug('shcooltypename1'+schoolname); return schoollist; } set; } public PageReference incrementCounter() { schoolname=getschoollist(); displaySearchResults=true; date Next = system.today()+1; date Last = system.today()-2; objRecEvent=[SELECT id,name,Location__c,Season__c,Account__c,Room__c,Status__c,Start_Date__c,End_Date__c FROM Recruiting_Event__c WHERE Account__c =:selectedValue and Status__c ='In Progress']; system.debug('++y'); return null; } public pagereference Save() { emailc=con.Email; insert con; con=new Contact (); objEvent= new Event_Registration__c (); objContact =[select id,name,FirstName,LastName,MobilePhone,Email from Contact where email= :emailc limit 1]; objEvent.Contact__c=ObjContact[0].id; system.debug('bugcontact'+ObjContact[0].id); ObjEvent.Recruiting_Event__c='a0GW00000018WpRMAU'; ObjEvent.Attended__c=True; insert objEvent; PageReference pr=new PageReference('/apex/eventRegistration/checkin'); pr.setRedirect(true); return pr; } }
Here is my Code and what i am looking for ..........
Can you please help me out...........

Using the Search option by giving the Email Id in the text fileld i am able to fetch the Data for that Record . When i get list of Records i want to select the single Reord .
(we can use either Radio Button/Check Box) Or Any Button.  Wwhen User select the single record.the row that we fetched through the email was to be attached to the  id , and on selecting the  Radio button/Button/Check Box there is to be another popup box/Page Block / has to b e displayed in the same page  asking the user to select the options of Attended uisng the Radio button on selcting the radio button and click on save itt has tobe saved into the Database.

Here we are Using the Conatct Object

Event Object  is an Custom Object
and Recruitiung Event Object is another Custom Object

Please let me know if wnat to know further details........

I am not able post this at " http://boards.developerforce.com”" can you please this post there also so that i get some other answers 


Here is my code

This is my Contoller
===================

public class RecruitingEventExtentionController
{
public id contactid{get;set;}
public Boolean displaySearchResults{get;set;}
public String inputemail {get;set;}
Set<Id> sObjectIds = new Set<Id>();
Set<id> sObjectrecIds = new Set<id>();
public List<Event_Registration__c> ObjEvent{get;set;}
public List<Recruiting_Event__c> ObjRecEvent{get;set;}
public List<Contact> objContact {get;set;}
public RecruitingEventExtentionController(ApexPages.StandardController controller) {
displaySearchResults=false;
}
public PageReference search()
{
try
{
List<Contact> objContact = new List<Contact>();
objContact = [select id,name,FirstName,LastName,MobilePhone,Email from Contact where email= :inputemail limit 1];
for(Event_Registration__c e:[select id,Name,Contact__c,Recruiting_Event__c,Attending__c,Attended__c,Invited__c,No_Response__c,No_Show__c,UserResponse__c from Event_Registration__c where Contact__c=:ObjContact[0].id and Attended__c=False limit 10])
{
sObjectIds.add(e.id);
sObjectrecIds.add(e.Recruiting_Event__c);
}
ObjEvent=[Select id,Name,Contact__c,Recruiting_Event__c from Event_Registration__c where id =:sObjectIds order by id limit 10];
ObjRecEvent=[Select id,Campus_Contact__c,Location__c,Type__c,End_Date__c,Start_Date__c,Class__c,Name,Year_FY__c,Time__c,Team__c,System_ID__c,Status__c,Season__c,Room__c,Recruiting_Event_ID__c,Deloitte_Contact__c,Program__c,Practitioner_Event_Lead__c,Post_Event_Notes__c,Description__c from Recruiting_Event__c where id=:sObjectrecIds order by id limit 10];
if(ObjEvent.size()>0){
displaySearchResults=true;
}
else{
displaySearchResults=false;
}
inputemail ='';
sObjectIds.clear();
sObjectrecIds.clear();
}
catch(Exception ex){
System.debug('\n\nException ='+ex.getMessage()+'\n\n');
sObjectIds.clear();
}
return null;
}
public void cancel(){}

}



=====================

VF Page



<apex:page standardController="Event_Registration__c" extensions="RecruitingEventExtentionController" showHeader="False" sidebar="false">
<c:EventRegistration />
<apex:form >
<apex:pageblock title="" >
<apex:pageBlockSection >
<table><tr><td>Provide Your Email Address</td><td><apex:inputText id="inputemail" value="{!inputemail}"/></td></tr></table>
<apex:commandButton value="Search" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton>
</apex:pageBlockSection>
<apex:outputpanel id="searchResults">
<table width="100%"><tr><td width="70%"><apex:pageBlockTable rendered="{!displaySearchResults}" id="diTable" value="{!ObjRecEvent}" var="idat" border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="6px" columnsWidth="150px,150px,150px,150px,150px,150px" rowclasses="oddrows,evenrows">
<apex:column headerValue="Recuring Event Id" ><apex:outputField value="{!idat.id}" rendered="{!IF(ISBLANK(idat.id), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Recuring Event Name" ><apex:outputField value="{!idat.Name}" rendered="{!IF(ISBLANK(idat.Name), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Campus Contact" ><apex:outputField value="{!idat.Campus_Contact__c}" rendered="{!IF(ISBLANK(idat.Campus_Contact__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Location">
<apex:outputField value="{!idat.Location__c}" rendered="{!IF(ISBLANK(idat.Location__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Season">
<apex:outputField value="{!idat.Season__c}" rendered="{!IF(ISBLANK(idat.Season__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Room">
<apex:outputField value="{!idat.Room__c}" rendered="{!IF(ISBLANK(idat.Room__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Status">
<apex:outputField value="{!idat.Status__c}" rendered="{!IF(ISBLANK(idat.Status__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Start Date">
<apex:outputField value="{!idat.Start_Date__c}" rendered="{!IF(ISBLANK(idat.Start_Date__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="End Date">
<apex:outputField value="{!idat.End_Date__c}" rendered="{!IF(ISBLANK(idat.End_Date__c), 'false', 'true')}"/>
</apex:column> <apex:column rendered=""><apex:commandButton value="" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton></apex:column>

</apex:pageBlockTable></td><td width="30%"><apex:pageBlockTable rendered="{!displaySearchResults}" id="dTable" value="{!ObjEvent}" var="dat" border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="6px" columnsWidth="150px,150px,150px,150px,150px,150px" rowclasses="oddrows,evenrows">
<apex:column ><apex:commandButton value="Search" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton> </apex:column>

<apex:column headerValue="Event Id" ><apex:outputField value="{!dat.id}" rendered="{!IF(ISBLANK(dat.id), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Event Name" ><apex:outputField value="{!dat.Recruiting_Event__c}" rendered="{!IF(ISBLANK(dat.Recruiting_Event__c ), 'false', 'true')}"/>
</apex:column>

</apex:pageBlockTable>
</td></tr><tr><td></td></tr></table>

</apex:outputpanel></apex:pageBlock>
</apex:form>
</apex:page>


Can Anyone help me out from this

Hi , can any one help me.

i have scenerio where

RecordType = A, PriceBook = A, Product = A are fileds when we save with record like this i want a trigger to get invoke and save the record to the Opportunity.

 

Hi Jeff,

Need your help .

I have written a  test class where i was unable to cover the code coverage for the Inner class.

I have a class which have 2 class in one class . when i have  written a test class i was unablk to cover the code coverage 1 class.

This is my controller :

global class JobSearch
{
    public String searchemail {get;set;}
    public string persearch{get;set;}
    public string jobDesc{get;set;}
    public List<Job__c> objJob{get;set;}
    public Job__c newjob{get;set;} 
    public List<List<Sobject>> objJobList{get;set;} 
    public JobSearch(ApexPages.StandardController controller)
    {
    List<Job__c> ObjJob= new List<Job__c>();
   
    List<List<Sobject>> objJobList = new List<List<Job__c>>(); 
     newjob = new Job__c();
    objJob=[Select Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c where Name like :searchemail limit 1];

    //objJobList = [FIND 'Name' IN ALL FIELDS RETURNING Job__c(Id,Name,Account__c,Industry__c,Job_Category__c,Career_Level__c)];
    }
  public PageReference search()
    {
     try
       {
   
    persearch = '%'+searchemail+'%';
   // objJob=[Select Id,Name,Account__c,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c from Job__c where Name like :persearch or Industry__c like :persearch or Account__r.Name like :persearch or CCL_Job_Type__c like :persearch or Job_Category__c like :persearch limit 10000];
    objJob=[Select Description__c,Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c where Name like :persearch or Industry__c like :persearch or Account__r.Name like :persearch or FSS_CCL__c like :persearch or Location__c like :persearch limit 10000];

     objJobList = [FIND 'Name'  IN ALL FIELDS RETURNING Job__c(Id,Name,Account__c,Industry__c,Job_Category__c,Career_Level__c)];   
   
   
    }
    catch(Exception ex){
          System.debug('\n\nException ='+ex.getMessage()+'\n\n');
          searchemail ='';

    

     }
    return null;
    }
   
   public String searchedRecordId { get; set; }
    public static list<ResultSet> searchedRecord {get;set;}   
    @RemoteAction
    global static ResultSet[] getRecords(String searchText) {
        //sObject List
        searchedRecord = new list<ResultSet>();
        //SOSL Text should be more then one charecter
        if(searchText.length() >0){
            //SOSL opretion to retrive records of the Account, Lead, Contact, Opportunity, Lead Objects you can add more.
            List<List<SObject>> searchList = [FIND :searchText IN ALL FIELDS RETURNING Job__c(Id,Name,Industry__c)];
            //Adding diffrent object's records in sobject list
            for(List<SObject> o:searchList){
                for(SObject s:o){
                    searchedRecord.add(new JobSearch.ResultSet(s));
                }
            }
        }

        return searchedRecord;
    }

      global class ResultSet{
        public String Id {get;set;}
        public String Name{get;set;}
        //public String Level__c{get;set;}
      // public String Description {get;set;}
       // public String sObjectName {get;set;}
        public ResultSet(sObject s){
            this.Id = s.Id;
            this.Name = s.get('Name')+'';
          //  this.Level__c=s.get('City__c')+'';
          //  this.Description = s.get('Description')+'';
            //this.sObjectName = getsObjectNameById(Id);           
        }      
        global ResultSet(String Id,String Name){
            this.Id = Id;
            this.Name = Name;
           //this.Level__c=City__c;
            //this.Description = Description;
            //this.Description__c= Description__c;
            //this.sObjectName = getsObjectNameById(Id);           
        }
 
    }   
   
           }


Test class

@isTest(SeeAllData=true)
private class TestJobSearch
{        
private static testMethod void TestJobSearch()
      {
         contact con=new contact(Lastname='A',Email='ryeturi@deloitte.com',FirstName='Srikanth',Phone='9620566619');
         insert con;
         List<Job__c> objJob = new List<Job__c>();
        objJob=[Select Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c limit 1];
   
      Asset assetObj = new Asset(Name = 'Test Asset');
      insert assetObj;
   
       ApexPages.StandardController sc = new ApexPages.StandardController(con);   
       JobSearch createCon = new JobSearch(sc);
             
       PageReference pageRef = Page.jobsearchrepeat;
       Test.setCurrentPage(pageRef);
                 
                   createCon.search();
    }
       }

The Class is fine worked for the Upper class ,but i cannot able to call the 2nd class which is in Bold letters.........
My code coverage is 47% only , can anyone help me out from this so that i can cover min 75% code coverage to move it to production
Hi ,

I have  stuck with the Validation Rules using the Java Script , Can anyone help me out from this.

I have implemeted the Validation rule for the Server Side , but i  have stuck with it in implemeting it in Java Script.

This is the Validation rule that i have implemented for Server Side for Multiple Stage and the same i want to implemet it in Client Side using the Java scripe

Here is the Server side Validation Rule 


OR
(
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR( ISPICKVAL(CRM_Stage__c,"Stage 3: National/CEO Interviews")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 4: Board Interviews")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 5: Board Package Finalization")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR( ISPICKVAL(CRM_Stage__c,"Stage 6: Package Review")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 7: Approved/Agreement Finalization")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 8: Provisioning/On-Boarding")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 9: On-Board")), CRM_Gender__c =""))


And here is my Java script cod efor Validation rule

else if(voptygender== "" && (voptystage == 'Stage 3: National/CEO Interviews'))
{
    alert("Race is a required for Stage 3: National/CEO Interviews");
  document.getElementById('{!$Component.formid.op.keyid.optyrace}').focus();
}

This is working for only one Stage , but when i have implemeted it for the Multiple Stages it is throwing error whe it is in blank stage that is fine , but when i have save it with without blank with Specified message it has to save it but still it is throwing error

Here is the Code that i have implented for the Multiple stages using  Java Script

else if(voptygender == "" && (voptystage == 'Stage 3: National/CEO Interviews') || (voptystage == 'Stage 4: Board Interviews') || (voptystage == 'Stage 5: Board Package Finalization') || (voptystage == 'Stage 6: Package Review') || ( voptystage == 'Stage 7: Approved/Agreement Finalization') || (voptystage == 'Stage 8: Provisioning/On-Boarding') || ( voptystage== 'Stage 9: On-Board'))
{
  alert("Gender is a required for Stage 3: National/CEO Interviews");
  document.getElementById('{!$Component.formid.op.keyid.optygender}').focus();
}

Can Anyone correct me  where exactly i gone wrong 


Reagrds
Micky
Here is my Code and what i am looking for ..........
Can you please help me out...........

Using the Search option by giving the Email Id in the text fileld i am able to fetch the Data for that Record . When i get list of Records i want to select the single Reord .
(we can use either Radio Button/Check Box) Or Any Button.  Wwhen User select the single record.the row that we fetched through the email was to be attached to the  id , and on selecting the  Radio button/Button/Check Box there is to be another popup box/Page Block / has to b e displayed in the same page  asking the user to select the options of Attended uisng the Radio button on selcting the radio button and click on save itt has tobe saved into the Database.

Here we are Using the Conatct Object

Event Object  is an Custom Object
and Recruitiung Event Object is another Custom Object

Please let me know if wnat to know further details........

I am not able post this at " http://boards.developerforce.com”" can you please this post there also so that i get some other answers 


Here is my code

This is my Contoller
===================

public class RecruitingEventExtentionController
{
public id contactid{get;set;}
public Boolean displaySearchResults{get;set;}
public String inputemail {get;set;}
Set<Id> sObjectIds = new Set<Id>();
Set<id> sObjectrecIds = new Set<id>();
public List<Event_Registration__c> ObjEvent{get;set;}
public List<Recruiting_Event__c> ObjRecEvent{get;set;}
public List<Contact> objContact {get;set;}
public RecruitingEventExtentionController(ApexPages.StandardController controller) {
displaySearchResults=false;
}
public PageReference search()
{
try
{
List<Contact> objContact = new List<Contact>();
objContact = [select id,name,FirstName,LastName,MobilePhone,Email from Contact where email= :inputemail limit 1];
for(Event_Registration__c e:[select id,Name,Contact__c,Recruiting_Event__c,Attending__c,Attended__c,Invited__c,No_Response__c,No_Show__c,UserResponse__c from Event_Registration__c where Contact__c=:ObjContact[0].id and Attended__c=False limit 10])
{
sObjectIds.add(e.id);
sObjectrecIds.add(e.Recruiting_Event__c);
}
ObjEvent=[Select id,Name,Contact__c,Recruiting_Event__c from Event_Registration__c where id =:sObjectIds order by id limit 10];
ObjRecEvent=[Select id,Campus_Contact__c,Location__c,Type__c,End_Date__c,Start_Date__c,Class__c,Name,Year_FY__c,Time__c,Team__c,System_ID__c,Status__c,Season__c,Room__c,Recruiting_Event_ID__c,Deloitte_Contact__c,Program__c,Practitioner_Event_Lead__c,Post_Event_Notes__c,Description__c from Recruiting_Event__c where id=:sObjectrecIds order by id limit 10];
if(ObjEvent.size()>0){
displaySearchResults=true;
}
else{
displaySearchResults=false;
}
inputemail ='';
sObjectIds.clear();
sObjectrecIds.clear();
}
catch(Exception ex){
System.debug('\n\nException ='+ex.getMessage()+'\n\n');
sObjectIds.clear();
}
return null;
}
public void cancel(){}

}



=====================

VF Page



<apex:page standardController="Event_Registration__c" extensions="RecruitingEventExtentionController" showHeader="False" sidebar="false">
<c:EventRegistration />
<apex:form >
<apex:pageblock title="" >
<apex:pageBlockSection >
<table><tr><td>Provide Your Email Address</td><td><apex:inputText id="inputemail" value="{!inputemail}"/></td></tr></table>
<apex:commandButton value="Search" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton>
</apex:pageBlockSection>
<apex:outputpanel id="searchResults">
<table width="100%"><tr><td width="70%"><apex:pageBlockTable rendered="{!displaySearchResults}" id="diTable" value="{!ObjRecEvent}" var="idat" border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="6px" columnsWidth="150px,150px,150px,150px,150px,150px" rowclasses="oddrows,evenrows">
<apex:column headerValue="Recuring Event Id" ><apex:outputField value="{!idat.id}" rendered="{!IF(ISBLANK(idat.id), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Recuring Event Name" ><apex:outputField value="{!idat.Name}" rendered="{!IF(ISBLANK(idat.Name), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Campus Contact" ><apex:outputField value="{!idat.Campus_Contact__c}" rendered="{!IF(ISBLANK(idat.Campus_Contact__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Location">
<apex:outputField value="{!idat.Location__c}" rendered="{!IF(ISBLANK(idat.Location__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Season">
<apex:outputField value="{!idat.Season__c}" rendered="{!IF(ISBLANK(idat.Season__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Room">
<apex:outputField value="{!idat.Room__c}" rendered="{!IF(ISBLANK(idat.Room__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Status">
<apex:outputField value="{!idat.Status__c}" rendered="{!IF(ISBLANK(idat.Status__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Start Date">
<apex:outputField value="{!idat.Start_Date__c}" rendered="{!IF(ISBLANK(idat.Start_Date__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="End Date">
<apex:outputField value="{!idat.End_Date__c}" rendered="{!IF(ISBLANK(idat.End_Date__c), 'false', 'true')}"/>
</apex:column> <apex:column rendered=""><apex:commandButton value="" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton></apex:column>

</apex:pageBlockTable></td><td width="30%"><apex:pageBlockTable rendered="{!displaySearchResults}" id="dTable" value="{!ObjEvent}" var="dat" border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="6px" columnsWidth="150px,150px,150px,150px,150px,150px" rowclasses="oddrows,evenrows">
<apex:column ><apex:commandButton value="Search" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton> </apex:column>

<apex:column headerValue="Event Id" ><apex:outputField value="{!dat.id}" rendered="{!IF(ISBLANK(dat.id), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Event Name" ><apex:outputField value="{!dat.Recruiting_Event__c}" rendered="{!IF(ISBLANK(dat.Recruiting_Event__c ), 'false', 'true')}"/>
</apex:column>

</apex:pageBlockTable>
</td></tr><tr><td></td></tr></table>

</apex:outputpanel></apex:pageBlock>
</apex:form>
</apex:page>


Can Anyone help me out from this
Hi Jeff,

Need your help .

I have written a  test class where i was unable to cover the code coverage for the Inner class.

I have a class which have 2 class in one class . when i have  written a test class i was unablk to cover the code coverage 1 class.

This is my controller :

global class JobSearch
{
    public String searchemail {get;set;}
    public string persearch{get;set;}
    public string jobDesc{get;set;}
    public List<Job__c> objJob{get;set;}
    public Job__c newjob{get;set;} 
    public List<List<Sobject>> objJobList{get;set;} 
    public JobSearch(ApexPages.StandardController controller)
    {
    List<Job__c> ObjJob= new List<Job__c>();
   
    List<List<Sobject>> objJobList = new List<List<Job__c>>(); 
     newjob = new Job__c();
    objJob=[Select Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c where Name like :searchemail limit 1];

    //objJobList = [FIND 'Name' IN ALL FIELDS RETURNING Job__c(Id,Name,Account__c,Industry__c,Job_Category__c,Career_Level__c)];
    }
  public PageReference search()
    {
     try
       {
   
    persearch = '%'+searchemail+'%';
   // objJob=[Select Id,Name,Account__c,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c from Job__c where Name like :persearch or Industry__c like :persearch or Account__r.Name like :persearch or CCL_Job_Type__c like :persearch or Job_Category__c like :persearch limit 10000];
    objJob=[Select Description__c,Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c where Name like :persearch or Industry__c like :persearch or Account__r.Name like :persearch or FSS_CCL__c like :persearch or Location__c like :persearch limit 10000];

     objJobList = [FIND 'Name'  IN ALL FIELDS RETURNING Job__c(Id,Name,Account__c,Industry__c,Job_Category__c,Career_Level__c)];   
   
   
    }
    catch(Exception ex){
          System.debug('\n\nException ='+ex.getMessage()+'\n\n');
          searchemail ='';

    

     }
    return null;
    }
   
   public String searchedRecordId { get; set; }
    public static list<ResultSet> searchedRecord {get;set;}   
    @RemoteAction
    global static ResultSet[] getRecords(String searchText) {
        //sObject List
        searchedRecord = new list<ResultSet>();
        //SOSL Text should be more then one charecter
        if(searchText.length() >0){
            //SOSL opretion to retrive records of the Account, Lead, Contact, Opportunity, Lead Objects you can add more.
            List<List<SObject>> searchList = [FIND :searchText IN ALL FIELDS RETURNING Job__c(Id,Name,Industry__c)];
            //Adding diffrent object's records in sobject list
            for(List<SObject> o:searchList){
                for(SObject s:o){
                    searchedRecord.add(new JobSearch.ResultSet(s));
                }
            }
        }

        return searchedRecord;
    }

      global class ResultSet{
        public String Id {get;set;}
        public String Name{get;set;}
        //public String Level__c{get;set;}
      // public String Description {get;set;}
       // public String sObjectName {get;set;}
        public ResultSet(sObject s){
            this.Id = s.Id;
            this.Name = s.get('Name')+'';
          //  this.Level__c=s.get('City__c')+'';
          //  this.Description = s.get('Description')+'';
            //this.sObjectName = getsObjectNameById(Id);           
        }      
        global ResultSet(String Id,String Name){
            this.Id = Id;
            this.Name = Name;
           //this.Level__c=City__c;
            //this.Description = Description;
            //this.Description__c= Description__c;
            //this.sObjectName = getsObjectNameById(Id);           
        }
 
    }   
   
           }


Test class

@isTest(SeeAllData=true)
private class TestJobSearch
{        
private static testMethod void TestJobSearch()
      {
         contact con=new contact(Lastname='A',Email='ryeturi@deloitte.com',FirstName='Srikanth',Phone='9620566619');
         insert con;
         List<Job__c> objJob = new List<Job__c>();
        objJob=[Select Job_ID__c,Id,Name,Account__r.Name,CCL_Job_Type__c,Post_Date__c,Industry__c,Job_Category__c,Career_Level__c,AR_Salary__c,AR_Job_Details__c,AR_Job_Application_Link__c from Job__c limit 1];
   
      Asset assetObj = new Asset(Name = 'Test Asset');
      insert assetObj;
   
       ApexPages.StandardController sc = new ApexPages.StandardController(con);   
       JobSearch createCon = new JobSearch(sc);
             
       PageReference pageRef = Page.jobsearchrepeat;
       Test.setCurrentPage(pageRef);
                 
                   createCon.search();
    }
       }

The Class is fine worked for the Upper class ,but i cannot able to call the 2nd class which is in Bold letters.........
My code coverage is 47% only , can anyone help me out from this so that i can cover min 75% code coverage to move it to production
Hi ,

I was assigned to write a  Test class , where i was unable to cover the code coverage for the entire class i can able to pass the test class, but unable to cover the code coverage

Here is my Test class

@isTest(SeeAllData=true)
public class Test_CreateContactController
{

private static testMethod void TestCreateContactController()
  {
        
          Set<Id> sObjectIds = new Set<Id>(); 
          Set<id> sObjectrecIds = new Set<id>();
         set<id> campusrecid = new set<id>();
          List<id> acids = new List<id>();         
           List<RecordType> RecordTypeids = new List<RecordType>();        
         contact con=new contact();
         con.Lastname='Vishalg';
         con.Email='gaur@deloitte.com';
         con.FirstName='Gaur';
         con.Title='SiteDemo';
         con.Phone='7875434250';
        //con.recordtypeid=RecordTypeids[0].id;       
       // con.Recruiting_Event__c=objRecEvent.ID;    
        
         insert con;
        
           List<Event_Registration__c> ObjEvent = [Select id,Name,Contact__c,Recruiting_Event__c,Attended__c,Attending__c  from Event_Registration__c where id =:sObjectIds order by id limit 10]; 
            if (ObjEvent.size() > 0)
            {
           
             ObjEvent[0].Attended__C = true;
            ObjEvent[0].Attending__C = true;
             update ObjEvent;
            } 
           
            
              Recruiting_Event__c objRecEvent =  new Recruiting_Event__c();// [SELECT id,name,Location__c,Season__c,Account__c,Room__c,Status__c,Start_Date__c,End_Date__c FROM Recruiting_Event__c  limit 1];
               objRecEvent.name='Madhava Palla Event';
             objRecEvent.Season__c='Winter 2014';
              objRecEvent.Account__c='001R000000oYU5K';
              objRecEvent.Start_Date__c=system.today()-1;        
              objRecEvent.End_Date__c=system.today()+1;
               insert objRecEvent; 
             
               //List<Account> school = new List<Account>(); 
               //school=[Select id,Name from Account where id in :acids order by Name];  
              //insert school;
             
            List<Account> school = new List<Account>();
            //school.Name='001R000000oYU5K';
            //insert school;
                 


      ApexPages.StandardController sc = new ApexPages.StandardController(con);   
       CreateContactController createCon = new CreateContactController();  
           
       PageReference pageRef = Page.newregistration;
       Test.setCurrentPage(pageRef);
     
            
     createCon.displaySearchResults = true;
     createCon.selectedValue = '';
     createCon.schoolName ='';
     createCon.emailc ='';
     createCon.closePopup();
     createCon.getDisplaypblock();
    createCon.getschoollist();
    createCon.showPopup();
    createCon.cancel();
    createCon.getschoollist();     
    createCon.incrementCounter();
    createCon.displayPopUp = true;
      createCon.displaySearchResults = false;
     
     }

}

Here is the Class that i was to write the Test Class

public class CreateContactController
{
   public PageReference closePopup() {
        displayPopup = false;
        return null;
    }
    public boolean displayPopUp { get; set; }
    public PageReference showPopup() {
        displayPopup = true;
        return null;
    }
    public String getDisplaypblock() {
        return null;
    }
    public string schoolname{get;set;}
    public string emailc{get;set;}
    public Contact con{get; set;}
    public List<Contact> objContact {get;set;}
    public Event_Registration__c ObjEvent{get;set;}
    public List<Recruiting_Event__c> objRecEvent{get;set;}
    public Recruiting_Event__c ObjAccountRec{get;set;}
    public Boolean displaySearchResults{get;set;}
    public Recruiting_Event__c newrecevent{get;set;}
    public String selectedValue {get
    {
        if(selectedValue <> null && selectedValue <> '')
        {
            return selectedValue ;
        }
        else{
            selectedValue = '';
            return selectedValue ;
        }
    } set;}
    public List<id> acids = new List<id>();
    public List<Recruiting_Event__c> recevents= new List<Recruiting_Event__c>();
    public List<Account> school = new List<Account>();
    public List<Contact> user=new List<Contact>();
    public CreateContactController(ApexPages.StandardController controller) {
    newrecevent = new Recruiting_Event__c();
    this.newrecevent =(Recruiting_Event__c)controller.getRecord();
    con = new contact();
    }
    public PageReference Cancel() {
        return null;
    }
public String getschoollist() {
        return schoolname;
    }
    public CreateContactController()
    {
        con=new Contact ();
        ObjAccountRec = new Recruiting_Event__c();      

}
   public List<SelectOption> schoollist
    {
        get
        {   recevents= [Select Account__c,Name From Recruiting_Event__c];
            schoollist = new List<SelectOption>();
         for(Recruiting_Event__c temp : recevents)
            {  

                acids.add(temp.Account__c);
            }
         school=[Select id,Name from Account where id in :acids order by Name];  
         schoollist.add(new selectOption('--None--','--None--'));
         for(Account temp1: school)
         {
        schoollist.add(new SelectOption(temp1.Id,temp1.Name));
         }  
         system.debug('shcooltypename1'+schoolname);
        return schoollist;
                }
        set;
    }
public PageReference incrementCounter() {
        schoolname=getschoollist();
        displaySearchResults=true;
        date Next = system.today()+2;
        date cnow = system.today();
        date Last = system.today()-2;
        system.debug('systemNext'+Next);
        system.debug('systemLast'+Last);
        objContact=[SELECT id,name,email from contact where email=:con.Email limit 2];
        objRecEvent=[SELECT id,name,Location__c,Season__c,Account__c,Room__c,Status__c,Start_Date__c,End_Date__c FROM Recruiting_Event__c  WHERE Account__c =:selectedValue and Start_Date__c >=:Last and Start_Date__c <=:Next and Status__c<>'Completed'];     
        set<id> recids = new set<id>();
        set<id> campusrecid = new set<id>();
        List<RecordType> RecordTypeids = new List<RecordType>();
        RecordTypeids =[select id,name from RecordType where sobjecttype = 'Contact' and name='campus' limit 1];
        con.recordtypeid=RecordTypeids[0].id;
        con.Accountid=objRecEvent[0].Account__c;
        if(ObjContact.size()<=0){
        insert con;
        PageReference cr=new PageReference('https://eevent-deloittenet.cs2.force.com/event/newregistration_rec?cid='+con.id+'&acid='+objRecEvent[0].Account__c);
        cr.setRedirect(true);
        return cr;
        }      
        else
        {
        PageReference dr=new PageReference('https://eevent-deloittenet.cs2.force.com/event/newregistration_rec?cid='+objContact[0].id+'&acid='+objRecEvent[0].Account__c);
        dr.setRedirect(true);
        return dr;       
        }
       
       
    }
   
}
Hi,

I have a requirement .......

On Clicking a button using the CommanButton i need to refresh a PageBlock.

Apart from from PageBlock it is also rfershing the complete Page which should not happen.

Can any one help me out by looking into my code . Such that when i click on the Continue Button it has to refresh the Page Block such that on clicking the Continue button it will showcase the PageBlock which i am looking , but at the same time it is refreshing the  Page by which whatever the records that i selected will be get lost and user has to select the record once again. which should not happen.

Here is my code

<apex:page standardController="Recruiting_Event__c" extensions="MassEmailEventForCampus" id="pageid" sidebar="true" showHeader="true" tabStyle="Contact">

<style>
.mmSubheader {
background-color= #E2E3E5;
font size: 1em;
margin: 18px 0 7px;
padding: 4px 9px;
color: black;
font-weight:bold;
}
.label{
padding:3px;
color: #222222;font-family: Arial,Helvetica,sans-serif;
}
.he1 {

     font-weight: bold;
     -moz-user-select: text;
    font-family: 'Arial','Helvetica',sans-serif;
    font-size: 100%;
    line-height: normal;
    border-style: none solid none none;
    border-width: 0 1px 0 0;
    padding: 2px 0 3px;
    vertical-align: baseline;
     border-left-color: #EEEEEE;
    border-right-color: #D0D0D0;
    border-left: 1px solid;
    border-right: 1px solid;
    -moz-user-focus: normal;
    outline: medium none;
    text-align: left;
}
</style>
<script type="text/javascript">
document.getElementsByTagName("input").checked;
    function checkAll(cb,cbid)
        {
            var inputElem = document.getElementsByTagName("input");                   
            for(var i=0; i<inputElem.length; i++)
            {           
                 if(inputElem[i].id.indexOf(cbid)!=-1){                                      
                    inputElem[i].checked = cb.checked;
                }
            }
        }
</script>
<script language="javascript" type="text/javascript">
var pickListArray=[];
var campaignPickListArray=[];
function popUpLookUpWindow(url,col,val) {
      var colValue=document.getElementById(col).value;
      if(colValue!='None'){
      url=url+'&column='+colValue+'&val='+val;
    newwindow=window.open(url,'name','height=430,width=620,toolbar=no,resizable=yes,scrollbars=yes');
    if (window.focus) {newwindow.focus()}
    }
}
function closePopUp(){
   if (null!=newwindow)
    {
      newwindow.close();
    }
}
</script>
  <apex:form >
<apex:repeat value="{!pickListCol}" var="request">
        <script>
            pickListArray.push('{!request}');
        </script>
    </apex:repeat>
     <apex:repeat value="{!pickListCampaignCol}" var="list">
        <script>
            campaignPickListArray.push('{!list}');
        </script>
    </apex:repeat>
    <script>
   
function isPickList(selectedId,lookupId){

var val=document.getElementById(selectedId).value;
for (var i = 0; i < pickListArray.length; i++) {
// alert('pickListArray === ' + pickListArray[i]);
        if (pickListArray[i] ===val){
            document.getElementById(lookupId).style.display = "block";
            break;
            }else{
            document.getElementById(lookupId).style.display = "none";
            }
    }
}

function isCampaignPickList(selectedId,lookupId){
var val=document.getElementById(selectedId).value;
for (var i = 0; i < campaignPickListArray.length; i++) {
  // alert('campaignPickListArray=== ' + campaignPickListArray[i]);
        if (campaignPickListArray[i] ===val){
            document.getElementById(lookupId).style.display = "block";
            break;
            }else{
            document.getElementById(lookupId).style.display = "none";
            }
    }

}
  </script> <apex:sectionHeader subtitle="Mass Email"/>
<apex:pageBlock title="Step 1: Select email recipients">
<div class="mmSubheader">Select Event Name <apex:inputField value="{!eropty.Recruiting_Event__c}" id="crmcmpid">
  </apex:inputfield>
  
  <br></br>
  Attended <apex:inputField value="{!eropty.Attended__c}" id="crmcmpid1">
  </apex:inputfield>
  Attending <apex:inputField value="{!eropty.Attending__c}" id="crmcmpid2">
  </apex:inputfield>
Invited <apex:inputField value="{!eropty.Invited__c}" id="crmcmpid3">
  </apex:inputfield>
No Show <apex:inputField value="{!eropty.No_Show__c}" id="crmcmpid5">
  </apex:inputfield>
Not Attending <apex:inputField value="{!eropty.Not_Attending__c}" id="crmcmpid6">
  </apex:inputfield>
  No Response  <apex:inputCheckbox value="{!eropty.No_Response__c}" id="crmcmp1d7"/>

 
  <br></br>
 
 
 
 

</div> 

      <div class="mmSubheader" style="display:none">Choose Member Type to Search          </div>   
<div class="mmSubheader"></div>
 
    <apex:outputPanel id="criteria">
          <apex:actionstatus id="status" startText="Loading...">
             <apex:facet name="stop">
           
               <apex:outputPanel >
              
            
            <apex:commandButton action="{!go}" value="Search" reRender="searchProgress,results1,dTable" status="searchProgress" />
            <br/>
            <apex:actionStatus id="searchProgress">
                        <apex:facet name="start">
                            <table align="center" border="0">
                                <tr>
                                    <td style="vertical-align:middle;" align="center">
                                        <img src="{!$Resource.saveStatus}"/>
                                    </td>
                                </tr>
                            </table>
                        </apex:facet>
</apex:actionStatus>
              </apex:outputPanel>
         
            </apex:facet>
          </apex:actionstatus>
     </apex:outputPanel>
      <br/>
     <apex:pageBlockSection columns="1" >
     <script type="text/javascript">new MenuButton('MyMenu', false);</script>

    <apex:pageBlockTable id="dTable" value="{!contactList}" var="dat"  border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="4px" columnsWidth="60px,150px,150px,150px,170px" >
     <apex:column ><apex:facet name="header">
<apex:inputCheckbox onclick="checkAll(this,'checkedone')"/>
</apex:facet>
<apex:inputCheckbox value="{!dat.selected}" id="checkedone"/></apex:column>
   <apex:column headerValue="First Name"  ><apex:outputField value="{!dat.con.FirstName}" rendered="{!IF(ISBLANK(dat.con.FirstName), 'false', 'true')}"/>
   </apex:column>
     <apex:column headerValue="Last Name" ><apex:outputField value="{!dat.con.LastName}" rendered="{!IF(ISBLANK(dat.con.LastName), 'false', 'true')}"/> 
      </apex:column>
     <apex:column headerValue="Title" ><apex:outputField value="{!dat.con.Title}" rendered="{!IF(ISBLANK(dat.con.Title), 'false', 'true')}"/>
     </apex:column>
     <apex:column headerValue="Account Name" ><apex:outputField value="{!dat.con.AccountId}" rendered="{!IF(ISBLANK(dat.con.AccountId), 'false', 'true')}"/> </apex:column>
     <apex:column headerValue="Email"  ><apex:outputField value="{!dat.con.Email}" rendered="{!IF(ISBLANK(dat.con.Email), 'false', 'true')}"/>
     </apex:column>
          </apex:pageBlockTable>
          </apex:pageBlockSection>
    
     &nbsp; &nbsp; <apex:commandLink action="{!previousResults}" value="Previous" reRender="emailTemplateBlock"/> &nbsp; | &nbsp; <apex:commandLink action="{!nextResults}" value="Next" reRender="dTable" />
       
  
          
   <br></br><br></br>
</apex:pageBlock>
<apex:pageblock >
<apex:commandButton action="{!Save}" value="Continue..."/>
</apex:pageblock>

        <apex:pageBlock title="Step 2: Select an email template" id="emailTemplateBlock" rendered="{!displaypblock}">
                Select Email Template Folder:
            <apex:selectList value="{!selectedEmailTemplateFolder}" multiselect="false" size="1">
                <apex:selectOptions value="{!emailTemplateFolderOpts}" />
                <apex:actionSupport event="onchange" action="{!refreshEmailTemplateSection}" rerender="emailTemplateBlock" />
            </apex:selectList>
            <br/><br></br>
            Select Email Template:
            <apex:selectList value="{!selectedEmailTemplate}" multiselect="false" size="1" >
                <apex:selectOptions value="{!emailTemplateOpts}" />
<apex:actionSupport event="onchange" action="{!refreshEmailTemplateSectionid}" rerender="emailTemplateBlock" />               
                            </apex:selectList>
             <apex:outputLink target="_blank" value="{!emailTemplateId}">   Preview</apex:outputLink>            <br/><br></br>
                      
<apex:commandButton action="{!SendEmail}" value="Send Email" rendered="{!if(emailTemplateOpts.size > 0, true, false)}"/>
    </apex:pageBlock>  </apex:form>
</apex:page>

Regards
Micky
Hi ,

I have a visual force page  and an  controller .

We have a Button in my VF page called Continue ...>

when i click on this button i want to display below pageblock  " Select Email Template Folder " and " Select Email Template".

Currently i am viewing te VF Page with  pageblock  " Select Email Template Folder " and " Select Email Template" with out clicking the Contionue.

This my VF Page can any one help me out

<apex:page standardController="Event_Registration__c" extensions="MassEmailEvent" id="pageid" sidebar="true" showHeader="true" tabStyle="Contact">

<style>
.mmSubheader {
background-color= #E2E3E5;
font size: 1em;
margin: 18px 0 7px;
padding: 4px 9px;
color: black;
font-weight:bold;
}
.label{
padding:3px;
color: #222222;font-family: Arial,Helvetica,sans-serif;
}
.he1 {

     font-weight: bold;
     -moz-user-select: text;
    font-family: 'Arial','Helvetica',sans-serif;
    font-size: 100%;
    line-height: normal;
    border-style: none solid none none;
    border-width: 0 1px 0 0;
    padding: 2px 0 3px;
    vertical-align: baseline;
     border-left-color: #EEEEEE;
    border-right-color: #D0D0D0;
    border-left: 1px solid;
    border-right: 1px solid;
    -moz-user-focus: normal;
    outline: medium none;
    text-align: left;
}
</style>
<script type="text/javascript">
    function checkAll(cb,cbid)
        {
            var inputElem = document.getElementsByTagName("input");                   
            for(var i=0; i<inputElem.length; i++)
            {           
                 if(inputElem[i].id.indexOf(cbid)!=-1){                                      
                    inputElem[i].checked = cb.checked;
                }
            }
        }
</script>
<script language="javascript" type="text/javascript">
var pickListArray=[];
var campaignPickListArray=[];
function popUpLookUpWindow(url,col,val) {
      var colValue=document.getElementById(col).value;
      if(colValue!='None'){
      url=url+'&column='+colValue+'&val='+val;
    newwindow=window.open(url,'name','height=430,width=620,toolbar=no,resizable=yes,scrollbars=yes');
    if (window.focus) {newwindow.focus()}
    }
}
function closePopUp(){
   if (null!=newwindow)
    {
      newwindow.close();
    }
}
</script>
  <apex:form >
<apex:repeat value="{!pickListCol}" var="request">
        <script>
            pickListArray.push('{!request}');
        </script>
    </apex:repeat>
     <apex:repeat value="{!pickListCampaignCol}" var="list">
        <script>
            campaignPickListArray.push('{!list}');
        </script>
    </apex:repeat>
    <script>
   
function isPickList(selectedId,lookupId){

var val=document.getElementById(selectedId).value;
for (var i = 0; i < pickListArray.length; i++) {
// alert('pickListArray === ' + pickListArray[i]);
        if (pickListArray[i] ===val){
            document.getElementById(lookupId).style.display = "block";
            break;
            }else{
            document.getElementById(lookupId).style.display = "none";
            }
    }
}

function isCampaignPickList(selectedId,lookupId){
var val=document.getElementById(selectedId).value;
for (var i = 0; i < campaignPickListArray.length; i++) {
  // alert('campaignPickListArray=== ' + campaignPickListArray[i]);
        if (campaignPickListArray[i] ===val){
            document.getElementById(lookupId).style.display = "block";
            break;
            }else{
            document.getElementById(lookupId).style.display = "none";
            }
    }

}
  </script> <apex:sectionHeader subtitle="Mass Email"/>
<apex:pageBlock title="Step 1: Select email recipients">
<div class="mmSubheader">Select Event Name <apex:inputField value="{!eropty.Recruiting_Event__c}" id="crmcmpid">
  </apex:inputfield>
  
  <br></br>
  Attended <apex:inputField value="{!eropty.Attended__c}" id="crmcmpid1">
  </apex:inputfield>
  Attending <apex:inputField value="{!eropty.Attending__c}" id="crmcmpid2">
  </apex:inputfield>
Invited <apex:inputField value="{!eropty.Invited__c}" id="crmcmpid3">
  </apex:inputfield>
No Show <apex:inputField value="{!eropty.No_Show__c}" id="crmcmpid5">
  </apex:inputfield>
Not Attending <apex:inputField value="{!eropty.Not_Attending__c}" id="crmcmpid6">
  </apex:inputfield>
No Responce<apex:inputField value="{!eropty.Not_Attending__c}" id="crmcmpid7">
  </apex:inputfield>
 
  <br></br>
 
 
 
 

</div> 

      <div class="mmSubheader" style="display:none">Choose Member Type to Search          </div>   
<div class="mmSubheader"></div>
 
    <apex:outputPanel id="criteria">
          <apex:actionstatus id="status" startText="Loading...">
             <apex:facet name="stop">
           
               <apex:outputPanel >
              
            
            <apex:commandButton action="{!go}" value="Search" reRender="searchProgress,results1,dTable" status="searchProgress" />
            <br/>
            <apex:actionStatus id="searchProgress">
                        <apex:facet name="start">
                            <table align="center" border="0">
                                <tr>
                                    <td style="vertical-align:middle;" align="center">
                                        <img src="{!$Resource.saveStatus}"/>
                                    </td>
                                </tr>
                            </table>
                        </apex:facet>
</apex:actionStatus>
              </apex:outputPanel>
         
            </apex:facet>
          </apex:actionstatus>
     </apex:outputPanel>
      <br/>
     <apex:pageBlockSection columns="1" >
     <script type="text/javascript">new MenuButton('MyMenu', false);</script>

    <apex:pageBlockTable id="dTable" value="{!contactList}" var="dat"  border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="4px" columnsWidth="60px,150px,150px,150px,170px" >
     <apex:column ><apex:facet name="header">
<apex:inputCheckbox onclick="checkAll(this,'checkedone')"/>
</apex:facet>
<apex:inputCheckbox value="{!dat.selected}" id="checkedone"/></apex:column>
   <apex:column headerValue="First Name"  ><apex:outputField value="{!dat.con.FirstName}" rendered="{!IF(ISBLANK(dat.con.FirstName), 'false', 'true')}"/>
   </apex:column>
     <apex:column headerValue="Last Name" ><apex:outputField value="{!dat.con.LastName}" rendered="{!IF(ISBLANK(dat.con.LastName), 'false', 'true')}"/> 
      </apex:column>
     <apex:column headerValue="Title" ><apex:outputField value="{!dat.con.Title}" rendered="{!IF(ISBLANK(dat.con.Title), 'false', 'true')}"/>
     </apex:column>
     <apex:column headerValue="Account Name" ><apex:outputField value="{!dat.con.AccountId}" rendered="{!IF(ISBLANK(dat.con.AccountId), 'false', 'true')}"/> </apex:column>
     <apex:column headerValue="Email"  ><apex:outputField value="{!dat.con.Email}" rendered="{!IF(ISBLANK(dat.con.Email), 'false', 'true')}"/>
     </apex:column>
          </apex:pageBlockTable>
          </apex:pageBlockSection>
    
     &nbsp; &nbsp; <apex:commandLink action="{!previousResults}" value="Previous" reRender="emailTemplateBlock"/> &nbsp; | &nbsp; <apex:commandLink action="{!nextResults}" value="Next" reRender="dTable" />
       
   <br></br><br></br><apex:commandButton action="{!Save}" value="Continue..." disabled="emailTemplateBlock" onclick="emailTemplateBlock" reRender="displaypblock"/>
</apex:pageBlock>

        <apex:pageBlock title="Step 2: Select an email template" id="emailTemplateBlock" rendered="{!displaypblock}">
                Select Email Template Folder:
            <apex:selectList value="{!selectedEmailTemplateFolder}" multiselect="false" size="1">
                <apex:selectOptions value="{!emailTemplateFolderOpts}" />
                <apex:actionSupport event="onchange" action="{!refreshEmailTemplateSection}" rerender="emailTemplateBlock" />
            </apex:selectList>
            <br/><br></br>
            Select Email Template:
            <apex:selectList value="{!selectedEmailTemplate}" multiselect="false" size="1" >
                <apex:selectOptions value="{!emailTemplateOpts}" />
<apex:actionSupport event="onchange" action="{!refreshEmailTemplateSectionid}" rerender="emailTemplateBlock" />               
                            </apex:selectList>
             <apex:outputLink target="_blank" value="{!emailTemplateId}">Preview</apex:outputLink>            <br/><br></br>
                      
<apex:commandButton action="{!SendEmail}" value="Send Email" rendered="{!if(emailTemplateOpts.size > 0, true, false)}"/>
    </apex:pageBlock>  </apex:form>
</apex:page>



Hi ,

I have  stuck with the Validation Rules using the Java Script , Can anyone help me out from this.

I have implemeted the Validation rule for the Server Side , but i  have stuck with it in implemeting it in Java Script.

This is the Validation rule that i have implemented for Server Side for Multiple Stage and the same i want to implemet it in Client Side using the Java scripe

Here is the Server side Validation Rule 


OR
(
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR( ISPICKVAL(CRM_Stage__c,"Stage 3: National/CEO Interviews")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 4: Board Interviews")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 5: Board Package Finalization")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR( ISPICKVAL(CRM_Stage__c,"Stage 6: Package Review")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 7: Approved/Agreement Finalization")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 8: Provisioning/On-Boarding")), CRM_Gender__c =""),
AND(OR(RecordTypeId ="01250000000UKjw",RecordTypeId="01250000000UKjv", RecordTypeId ="01250000000UMZm"),OR(ISPICKVAL(CRM_Stage__c,"Stage 9: On-Board")), CRM_Gender__c =""))


And here is my Java script cod efor Validation rule

else if(voptygender== "" && (voptystage == 'Stage 3: National/CEO Interviews'))
{
    alert("Race is a required for Stage 3: National/CEO Interviews");
  document.getElementById('{!$Component.formid.op.keyid.optyrace}').focus();
}

This is working for only one Stage , but when i have implemeted it for the Multiple Stages it is throwing error whe it is in blank stage that is fine , but when i have save it with without blank with Specified message it has to save it but still it is throwing error

Here is the Code that i have implented for the Multiple stages using  Java Script

else if(voptygender == "" && (voptystage == 'Stage 3: National/CEO Interviews') || (voptystage == 'Stage 4: Board Interviews') || (voptystage == 'Stage 5: Board Package Finalization') || (voptystage == 'Stage 6: Package Review') || ( voptystage == 'Stage 7: Approved/Agreement Finalization') || (voptystage == 'Stage 8: Provisioning/On-Boarding') || ( voptystage== 'Stage 9: On-Board'))
{
  alert("Gender is a required for Stage 3: National/CEO Interviews");
  document.getElementById('{!$Component.formid.op.keyid.optygender}').focus();
}

Can Anyone correct me  where exactly i gone wrong 


Reagrds
Micky
Here is my Code and what i am looking for ..........
Can you please help me out...........

Using the Search option by giving the Email Id in the text fileld i am able to fetch the Data for that Record . When i get list of Records i want to select the single Reord .
(we can use either Radio Button/Check Box) Or Any Button.  Wwhen User select the single record.the row that we fetched through the email was to be attached to the  id , and on selecting the  Radio button/Button/Check Box there is to be another popup box/Page Block / has to b e displayed in the same page  asking the user to select the options of Attended uisng the Radio button on selcting the radio button and click on save itt has tobe saved into the Database.

Here we are Using the Conatct Object

Event Object  is an Custom Object
and Recruitiung Event Object is another Custom Object

Please let me know if wnat to know further details........

I am not able post this at " http://boards.developerforce.com”" can you please this post there also so that i get some other answers 


Here is my code

This is my Contoller
===================

public class RecruitingEventExtentionController
{
public id contactid{get;set;}
public Boolean displaySearchResults{get;set;}
public String inputemail {get;set;}
Set<Id> sObjectIds = new Set<Id>();
Set<id> sObjectrecIds = new Set<id>();
public List<Event_Registration__c> ObjEvent{get;set;}
public List<Recruiting_Event__c> ObjRecEvent{get;set;}
public List<Contact> objContact {get;set;}
public RecruitingEventExtentionController(ApexPages.StandardController controller) {
displaySearchResults=false;
}
public PageReference search()
{
try
{
List<Contact> objContact = new List<Contact>();
objContact = [select id,name,FirstName,LastName,MobilePhone,Email from Contact where email= :inputemail limit 1];
for(Event_Registration__c e:[select id,Name,Contact__c,Recruiting_Event__c,Attending__c,Attended__c,Invited__c,No_Response__c,No_Show__c,UserResponse__c from Event_Registration__c where Contact__c=:ObjContact[0].id and Attended__c=False limit 10])
{
sObjectIds.add(e.id);
sObjectrecIds.add(e.Recruiting_Event__c);
}
ObjEvent=[Select id,Name,Contact__c,Recruiting_Event__c from Event_Registration__c where id =:sObjectIds order by id limit 10];
ObjRecEvent=[Select id,Campus_Contact__c,Location__c,Type__c,End_Date__c,Start_Date__c,Class__c,Name,Year_FY__c,Time__c,Team__c,System_ID__c,Status__c,Season__c,Room__c,Recruiting_Event_ID__c,Deloitte_Contact__c,Program__c,Practitioner_Event_Lead__c,Post_Event_Notes__c,Description__c from Recruiting_Event__c where id=:sObjectrecIds order by id limit 10];
if(ObjEvent.size()>0){
displaySearchResults=true;
}
else{
displaySearchResults=false;
}
inputemail ='';
sObjectIds.clear();
sObjectrecIds.clear();
}
catch(Exception ex){
System.debug('\n\nException ='+ex.getMessage()+'\n\n');
sObjectIds.clear();
}
return null;
}
public void cancel(){}

}



=====================

VF Page



<apex:page standardController="Event_Registration__c" extensions="RecruitingEventExtentionController" showHeader="False" sidebar="false">
<c:EventRegistration />
<apex:form >
<apex:pageblock title="" >
<apex:pageBlockSection >
<table><tr><td>Provide Your Email Address</td><td><apex:inputText id="inputemail" value="{!inputemail}"/></td></tr></table>
<apex:commandButton value="Search" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton>
</apex:pageBlockSection>
<apex:outputpanel id="searchResults">
<table width="100%"><tr><td width="70%"><apex:pageBlockTable rendered="{!displaySearchResults}" id="diTable" value="{!ObjRecEvent}" var="idat" border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="6px" columnsWidth="150px,150px,150px,150px,150px,150px" rowclasses="oddrows,evenrows">
<apex:column headerValue="Recuring Event Id" ><apex:outputField value="{!idat.id}" rendered="{!IF(ISBLANK(idat.id), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Recuring Event Name" ><apex:outputField value="{!idat.Name}" rendered="{!IF(ISBLANK(idat.Name), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Campus Contact" ><apex:outputField value="{!idat.Campus_Contact__c}" rendered="{!IF(ISBLANK(idat.Campus_Contact__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Location">
<apex:outputField value="{!idat.Location__c}" rendered="{!IF(ISBLANK(idat.Location__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Season">
<apex:outputField value="{!idat.Season__c}" rendered="{!IF(ISBLANK(idat.Season__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Room">
<apex:outputField value="{!idat.Room__c}" rendered="{!IF(ISBLANK(idat.Room__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Status">
<apex:outputField value="{!idat.Status__c}" rendered="{!IF(ISBLANK(idat.Status__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Start Date">
<apex:outputField value="{!idat.Start_Date__c}" rendered="{!IF(ISBLANK(idat.Start_Date__c), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="End Date">
<apex:outputField value="{!idat.End_Date__c}" rendered="{!IF(ISBLANK(idat.End_Date__c), 'false', 'true')}"/>
</apex:column> <apex:column rendered=""><apex:commandButton value="" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton></apex:column>

</apex:pageBlockTable></td><td width="30%"><apex:pageBlockTable rendered="{!displaySearchResults}" id="dTable" value="{!ObjEvent}" var="dat" border="1" cellspacing="2px" width="100%" headerClass="he1" cellpadding="6px" columnsWidth="150px,150px,150px,150px,150px,150px" rowclasses="oddrows,evenrows">
<apex:column ><apex:commandButton value="Search" action="{!search}" reRender="searchResults,displaySearchResults"></apex:commandButton> </apex:column>

<apex:column headerValue="Event Id" ><apex:outputField value="{!dat.id}" rendered="{!IF(ISBLANK(dat.id), 'false', 'true')}"/>
</apex:column>
<apex:column headerValue="Event Name" ><apex:outputField value="{!dat.Recruiting_Event__c}" rendered="{!IF(ISBLANK(dat.Recruiting_Event__c ), 'false', 'true')}"/>
</apex:column>

</apex:pageBlockTable>
</td></tr><tr><td></td></tr></table>

</apex:outputpanel></apex:pageBlock>
</apex:form>
</apex:page>


Can Anyone help me out from this

Hello community,

 

I need to update a custom field in my standard Contact, that fires after a different, Custom Object is updated, validated by a lookup relationship. (The Custom Object has the Contact, and Contact's Account, listed as Lookups)

 

I've tried to write a trigger that passes the field value from my Custom Object to the Contact, but I keep getting a variety of errors - the most recent of which has stumped me. The end goal is to update Passing__c from Passing_Field__c. At the moment, the system does not recognize 

p.Passing_Field__c

As a variable, which leads me to assume I'm not identifying the fields correctly to begin with. Is there a better way to do what I'm trying to accomplish here?

 

trigger ContactUpdater on Custom_Object_Name__c (after update) {

 List<Contact> updatedContacts = new List<Contact>();
 Set<Id> ObjectIds = new Set<Id>();
 Set<String> ObjectCont = new Set<String>();
 Set<Boolean> ObjectActive = new Set<Boolean>();
 Set<String> ObjectPass = new Set<String>(); 

 for(Custom_Object_Name__c p : trigger.new){
     If(p.Active__c == true){ 
       ObjectIds.add(p.Id);
       ObjectCont.add(p.Contact__c);
       ObjectActive.add(p.Active__c);
       ObjectPass.add(p.Passing_Field__c);
 }
 }
    try{
        for(Contact c : [SELECT Id, Passing__c FROM Contact WHERE (AccountId IN (Select Account__c from  Custom_Object_Name__c )) AND ObjectActive = true])
        {
          set(c.Passing__c = p.Passing_Field__c);
          c.FieldToUpdate = c.Passing__c;
          updatedContacts.add(c);
         }
         update updatedContacts; 

}

     catch(exception e){
        throw e;
 }

*Notes: Active_c is a checkbox. Passing_c and Passing_Field__c are both text boxes.*

Hi Everybody,

 

My visualforce page having 2 sections(Account and Contacts). If the Account having any contacts need to display Contacts section other wise display only Account section.

 

Used following statement in VFP, but contacts section visible even no records exists on Contact object to corresponding Account Id

<apexageblockSection columns="5" Title="Contacts" rendered="{!NOT(ISNULL(contactsLst))}">

 

 

Can you please share your ideas.

 

Thanks,

Krishna

 

 

  • May 24, 2011
  • Like
  • 0

Hi all,

 

      I Have problem with salesforce site. I am trying to insert record in standard object through site but i am getting an error that is ,

 

Authorization Required

You must first log in or register before accessing this page.
If you have forgotten your password, click Forgot Password to reset it.

 

-------

 

When i am trying it through visualforcepage on platform its working fine.

 

My VF Page is,

 

<apex:page Standardcontroller="Account">
   
  <apex:form >
   <apex:pageBlock title="Account Info">
 
      <apex:pageBlockButtons >
        <apex:commandButton action="{!save}" value="Save"/>
      </apex:pageBlockButtons>
 
      <apex:pageBlockSection showHeader="false" columns="2">
        <apex:inputField value="{!account.name}" />
      </apex:pageBlockSection>
 
    </apex:pageBlock>
  </apex:form>
</apex:page>

 

 

Can anybody suggest?

 

Thanks,

 

Anuja.

  • March 11, 2011
  • Like
  • 0

Hi all,

 

Is there any way of making a commandbutton run some apex code but not refresh on button click?

 

Cheers

 

James 

Hi, I am trying to make an attachment page on one of my custom pages. I am unable to find any totorial for this particular purpose. Can somebody please refer me to some tutorial that associates an attachment to the custom objects and controls.

 

I came accross teh follwoing example of uploading attachments. I am unable to run this code because I dont find any option to create the extension for the standardController-Document

 

    

<apex:page standardController="Document" extensions="documentExt"> <-- Upload a file and put it in your personal documents folder--> <apex:messages /> <apex:form id="theForm"> <apex:pageBlock> <apex:pageBlockSection> <apex:inputFile value="{!document.body}" filename="{!document.name}"/> <apex:commandButton value="save" action="{!save}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> /*** Controller ***/ public class documentExt { Appendix D: Standard Component Reference inputFile public documentExt(ApexPages.StandardController controller) { Document d = (Document) controller.getRecord(); d.folderid = UserInfo.getUserId(); //this puts it in My Personal Documents } }

 

Can someone please help me in:

1- How can I associate an attachments to my records when I am working with a custom controller (some code or step by step tutorial).

2- How can I add an extension when I am using a standard controlle