• Esther Thomas 2
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 5
    Replies
Hi Everyone
 I'm trying to get all my labels aligned in the the following VF page. I've tried various things without luck. Any suggestions on how to get the labels left justified? Also I'd like my picklists on the same row as the label as well. Can I use a table format in a VF page? I'm not sure what the best approach here is. Thanks.

User-added image
 
<apex:page standardController="Booking__c" extensions="testing10" docType="html-5.0">
    <apex:form >
    	<apex:pageBlock >
        	<apex:pageBlockSection >
                <apex:pageBlockSectionItem >
                <apex:outputLabel>Booking Date</apex:outputLabel>
                <apex:inputfield value="{!Records.Start_Date_Time__c}">
                <apex:actionSupport action="{!UpdateSitter}" event="onchange" reRender="D1"/>   
           		</apex:inputfield>
			    </apex:pageBlockSectionItem>                 
            </apex:pageBlockSection>
            
            <apex:pageBlockSection columns="1" id="D1">
               
                 <apex:outputLabel rendered="{!FlagH}">Baby Sitters</apex:outputLabel>
                 <apex:selectList value="{!SelectedSitter}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                 <apex:selectOptions value="{!RecordOption}" rendered="{!FlagH}"/> 
                    </apex:selectList>
              
                  <apex:outputLabel rendered="{!FlagH}">Clients</apex:outputLabel>
                  <apex:selectList value="{!SelectedClient}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                  <apex:selectOptions value="{!ClientOption}" rendered="{!FlagH}"/> 
                  </apex:selectList>
                 
                <apex:outputLabel rendered="{!FlagH}" >Hours Needed</apex:outputLabel>
                <apex:input type="number" value="{!BookHours}" html-min="2" html-max="10" style="width:40px;" rendered="{!FlagH}"/>
                
              </apex:pageBlockSection>
              <apex:pageBlockButtons location="bottom">
	          <apex:commandButton action="{!save}" value="Save"/>
	          </apex:pageBlockButtons>
            

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

 
Hi There,
 I have a VF email template with some merge fields. One in particular is a formual field that should return a currency. It shows up properly in my record detail page, however in the template it's missing the second decimal place holder. Instead of $90.00 it shows up in the email as $90.0.
Any suggestions on how to fix this formatting issue? Thanks.
 
<messaging:emailTemplate subject="Congratulations on your booking" recipientType="Contact" relatedToType="Booking__c">
<messaging:htmlEmailBody >
<html>
  <body>

  <apex:image id="logo" value="https://c.na78.content.force.com/servlet/servlet.ImageServer?id=0151N000003mGyc&oid=00D1N000001DEQc"/>
<p>Congratulations!</p>
<p>You have a new booking {!recipient.FirstName}</p>
<p>Your client is {!relatedTo.Client__r.First_Name__c} </p>
<p>Total Payment: {!relatedTo.Total_Price__c}</p>
  </body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

User-added image

User-added image
Hi Everyone,
 I'm trying to leverage the google data api toolkit. Following the instructions here: https://developer.salesforce.com/page/Google_Data_APIs_Toolkit_Setup, I'm trying to specify the SVN repository url mentinoed in teh doc.
http://apex-google-data.googlecode.com/svn/trunk/
However this is an invalid URL. I tried searching to see if maybe it's moved somewhere else but no luck. Has anyone set this up recently? If so do you have an updated link on where I can find the url for this step? Thank you.

 
Hi Everyone,
 I'm not even sure if workflow is the right solution here. After a record is inserted/updated, I want to send out an email.
I started creating a workflow but soon realized that when the workflow condition is met, the email recipient is not a contact or user in sfdc. it's the email that's in the custom field of the record that got inserted (lookup field). Is there anyway for me to extract that email from the associated created/updated record and send the email to that email address?
If I can't do this out of the box with workflows, is there a way I can trigger the email from an apex trigger that leverages the existing email template?
 
Hi there,
 I tried the following to control the width of my apex:input. this html-min seems to work for apex:inputfield but doesn't seem to be working with apex:input. Any help here is appreciated. Thank you.
 
<apex:outputLabel>Hours Needed</apex:outputLabel>
                <apex:input type="number" value="{!BookHours}" html-min="2" style="width:40x;"/>

 
Hi All,
  I want to add hours to a custom field and save the record. I'm able to save but when I look at the value for my custom field,
End_Date_Time__c it's the exact same as my Start_Date_Time__c. I'm not sure what I'm missing here. Thanks in advance for any help. 
 
public PageReference save(){
        try{
             //calculate end date/time
             hours=2;
             Records.End_Date_Time__c = (Records.Start_Date_Time__c + (hours/24));
                
             //assign client to new booking??????
             Records.Client__c = SelectedClient;
            
             //assign Availability/sitter?????????
             Records.Availability__c = SelectedSitter;
        
            insert Records;
        }catch(Exception e){
           
        }
            
        return null;
    }

 
Hi All,
 I'm using a custom apex controller. I have some master/detail relationships between some custom objects (Client --> Booking)
I'm trying to create a new child record on the Booking object (dependent child object). 
How do I specify the reference to the parent object when creating this new Booking record. 
I have a soql query that returns the existing clients which are then displayed in a selectList. 
I want to be able to associate the selected record in that select list as the master record associated with this new booking record. 
I'm hoping I'm not confusing the crap out of everyone. 
Here is my schema:
User-added image

Also as this is a custom controller, do I have to assign the Last Modified Date, Created By field values explicitly I can create a new booking record? I'm assuming nothing comes for free here? I'm not even sure what I'm suppose to put in those for those either. My primary hiccup is how do I assign the Availability and Client fields? Does that have to equal the Client.Name from the client object and Availability.Name from Availability Object?
 
<apex:page standardController="Booking__c" extensions="testing10" docType="html-5.0">
    <apex:form >
    	<apex:pageBlock >
        	<apex:pageBlockSection >
                <apex:pageBlockSectionItem >
                <apex:outputLabel >Booking Date</apex:outputLabel>
                <apex:inputfield value="{!Records.Start_Date_Time__c}">
                <apex:actionSupport action="{!UpdateSitter}" event="onchange" reRender="D1"/>   
           		</apex:inputfield>
	        </apex:pageBlockSectionItem>                 
                </apex:pageBlockSection>
            
            <apex:pageBlockSection columns="1" id="D1">
                 <apex:outputLabel rendered="{!FlagH}">Baby Sitters</apex:outputLabel>
                 <apex:selectList value="{!SelectedSitter}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                 <apex:selectOptions value="{!RecordOption}" rendered="{!FlagH}"/> 
                  </apex:selectList>
              
                  <apex:outputLabel rendered="{!FlagH}">Clients</apex:outputLabel>
                  <apex:selectList value="{!SelectedClient}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                  <apex:selectOptions value="{!ClientOption}" rendered="{!FlagH}"/> 
                  </apex:selectList>
                
                  <apex:outputLabel rendered="{!FlagH}">Number of Hours Needed</apex:outputLabel>
                  <apex:input type="number" id="hoursI" value="{!hours}" html-min="2" html-max="8" rendered="{!FlagH}"/      
                
              <apex:pageBlockTable value="{!Sdate}" var="sd" rendered="{!FlagH}">
                    <apex:column value="{!sd}"/>
                   <apex:column value="{!Record.End_Date_Time__c}"/>
             </apex:pageBlockTable>
                
              </apex:pageBlockSection>
              <apex:pageBlockButtons location="bottom">
	          <apex:commandButton action="{!save}" value="Save"/>
	          </apex:pageBlockButtons>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>

public class testing10 {
   public Booking__c Records{get;set;}
    public Boolean FlagH{get;set;}
    public Datetime DTime {get;set;}
    public List<SelectOption> RecordOption{get;set;} //stores the babysitters names in the picklist
    public Date PickDate{get;set;}
    public String Sdate{get;set;}
    public String SelectedSitter{get;set;}
    public String SelectedClient{get;set;}
    public List<SelectOption> ClientOption{get;set;} 
    public Integer hours{get;set;} 
  
 
    public PageReference UpdateSitter(){
  
      RecordOption = new List<SelectOption>();  //list to hold my babysitters returned 
      ClientOption = new List<SelectOption>(); //list to hold clients
        
        try{
          Dtime = Records.Start_Date_Time__c; //retrive datetime input 
          PickDate= DTime.date(); //convert datetime to date type
          Sdate = String.valueOf(PickDate);
          SelectedClient ='';
            
          RecordOption.add(new SelectOption('', '----Noness----'));
          ClientOption.add(new SelectOption('', '----Select Client----'));
            
          List<Availability__c> tempval = new List<Availability__c>([SELECT Id, Name, BabySitter__r.name, BabySitter__r.First_Name__c from Availability__c WHERE Date_Available__c =: PickDate and Booked__c=FALSE]);
          List<Client__c> tempClient = new List<Client__c>([SELECT Id, Name, First_Name__c, Last_Name__c from Client__c]);
            FlagH=false; //hides rendered block until returned date has an associated value (babysitters)
            if(tempval.size() > 0){  //babysitters are found
                FlagH=true;
                for(Availability__c a : tempval){
                    RecordOption.add(new SelectOption(a.Id, a.BabySitter__r.First_Name__c));
                }
               
                if (tempClient.size() > 0){
                      for(Client__c c : tempClient){
                    	ClientOption.add(new SelectOption(c.Id, c.Name));
                	}
				}
                
                //calculate end date/time
                Records.End_Date_Time__c = Records.Start_Date_Time__c + (hours/24);
                
                //assign client to new booking??????
                Records.Client__c = SelectedClient;
                
                //assign Availability/sitter?????????
                Records.Availability__r.Name = SelectedSitter;
              
            }
           
       
        }catch(Exception e){
            
        }    
       
        return null;
    }
    
    public PageReference save(){
        insert Records;
        //need to save booking with selected babysitter, selected date
        //update availability to booked (boolean)
        //return to listview page (parent page)
        return null;
    }
    public testing10(ApexPages.StandardController controller){
        FlagH = false;
        SelectedClient ='';
        SelectedSitter = '';
        Records = (Booking__c)controller.getRecord();
        
        
    }
    public testing10(){}
}

 
Hello there,
  I have a VF page with two selectList components. They should get re-rendered when I change my inputfield date. Any previously selected value in the selectList seems to reset for my first selectList but my second one still retains the previously selected value. I checked everywhere if I'm setting my rerender flag incorrectly, but no luck on finding the root cause. If someone can point me in a direction or can help me unblock this I would greatly appreciate it. Thanks in advance.
<apex:page standardController="Booking__c" extensions="testing10">
    <apex:form >
    	<apex:pageBlock >
        	<apex:pageBlockSection >
                <apex:pageBlockSectionItem >
                <apex:outputLabel >Booking Date</apex:outputLabel>
                <apex:inputfield value="{!Records.Start_Date_Time__c}">
                <apex:actionSupport action="{!UpdateSitter}" event="onchange" reRender="D1"/>   
           		</apex:inputfield>
			    </apex:pageBlockSectionItem>                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection columns="1" id="D1">
               
                 <apex:outputLabel rendered="{!FlagH}">Baby Sitters</apex:outputLabel>
                 <apex:selectList value="{!SelectedSitter}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                 <apex:selectOptions value="{!RecordOption}" rendered="{!FlagH}"/> 
                    </apex:selectList>
              
                  <apex:outputLabel rendered="{!FlagH}">Clients</apex:outputLabel>
                 <apex:selectList value="{!SelectedClient}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                 <apex:selectOptions value="{!ClientOption}" rendered="{!FlagH}"/> 
                    </apex:selectList>
                 
             
                
              <apex:pageBlockTable value="{!Sdate}" var="sd" rendered="{!FlagH}">
                    <apex:column value="{!sd}"/>
             </apex:pageBlockTable>
                
            </apex:pageBlockSection>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>

public class testing10 {
   public Booking__c Records{get;set;}
    public Boolean FlagH{get;set;}
    public Datetime DTime {get;set;}
    public List<SelectOption> RecordOption{get;set;} //stores the babysitters names in the picklist
    public Date PickDate{get;set;}
    public String Sdate{get;set;}
    public String SelectedSitter{get;set;}
    public String SelectedClient{get;set;}
    public List<SelectOption> ClientOption{get;set;} 
  
 
    public PageReference UpdateSitter(){
  
      RecordOption = new List<SelectOption>();  //list to hold my babysitters returned 
      ClientOption = new List<SelectOption>(); //list to hold clients
        
        try{
          Dtime = Records.Start_Date_Time__c; //retrive datetime input 
          PickDate= DTime.date(); //convert datetime to date type
          Sdate = String.valueOf(PickDate);
            
          RecordOption.add(new SelectOption('', '----Noness----'));
          ClientOption.add(new SelectOption('', '----Select Client----'));
            
          List<Availability__c> tempval = new List<Availability__c>([SELECT Id, Name, BabySitter__r.name, BabySitter__r.First_Name__c from Availability__c WHERE Date_Available__c =: PickDate and Booked__c=FALSE]);
          List<Client__c> tempClient = new List<Client__c>([SELECT Id, Name, First_Name__c, Last_Name__c from Client__c]);
            FlagH=false; //hides rendered block until returned date has an associated value (babysitters)
            if(tempval.size() > 0){  //babysitters are found
                FlagH=true;
                for(Availability__c a : tempval){
                    RecordOption.add(new SelectOption(a.Id, a.BabySitter__r.First_Name__c));
                }
                //expose client list
               
                if (tempClient.size() > 0){
                    //FlagH=true;
                      for(Client__c c : tempClient){
                    	ClientOption.add(new SelectOption(c.Id, c.Name));
                	}
				}
              
            }
           
       
        }catch(Exception e){
            
        }    
       
        return null;
    }
    public testing10(ApexPages.StandardController controller){
        FlagH = false;
        SelectedClient ='';
        SelectedSitter = '';
        Records = (Booking__c)controller.getRecord();
        
        
    }
    public testing10(){}
}



 
Hi Everyone,
 I'm trying a simple test
1. passing in a custom field (datetime) from my VF page to my apex controller.
2. take the datetime value passed and reassing it to a new datetime variable
3. convert datetime value in variable to string and have it re-rendered in my pagblocksection

When the action method is called, assigning that custom field datetime value seems to be throwing an exception. Pulling my hair out. Not sure where I've messed this up or misunderstood how this is suppose to work. Thanks in advance! 
 
<apex:page standardController="Booking__c" extensions="testing7">
    <apex:form>
        <apex:pageBlock>
        <apex:pageBlockSection>
            <apex:inputfield value="{!Records.Start_Date_Time__c}">
            <apex:actionSupport action="{!UpdateSitter}" event="onchange" reRender="D1"/>   
            </apex:inputfield>
        </apex:pageBlockSection>
            
        <apex:pageBlockSection columns="1" id="D1">          
            <apex:pageBlockTable value="{!Sdate}" var="sd" rendered="{!FlagH}">
            <apex:column value="{!sd}"/>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

public class testing7 {
    public Booking__c Records{get;set;}
    public String Sdate{get;set;}
    public Datetime DT{get;set;}
    public Boolean FlagH{get;set;}

    public PageReference UpdateSitter(){
        FlagH=true;
        try{ 
            DT = Records.Start_Date_Time__c;  //throwing an exception on this line
            Sdate=String.ValueOf(DT);
           }catch(System.NullPointerException e){
              Sdate='fail';
           }
        return null;
    }
    
    public testing7(ApexPages.StandardController controller)  {}
    
}

 
Hi there,
 I tried the following to control the width of my apex:input. this html-min seems to work for apex:inputfield but doesn't seem to be working with apex:input. Any help here is appreciated. Thank you.
 
<apex:outputLabel>Hours Needed</apex:outputLabel>
                <apex:input type="number" value="{!BookHours}" html-min="2" style="width:40x;"/>

 
Hi All,
 I'm using a custom apex controller. I have some master/detail relationships between some custom objects (Client --> Booking)
I'm trying to create a new child record on the Booking object (dependent child object). 
How do I specify the reference to the parent object when creating this new Booking record. 
I have a soql query that returns the existing clients which are then displayed in a selectList. 
I want to be able to associate the selected record in that select list as the master record associated with this new booking record. 
I'm hoping I'm not confusing the crap out of everyone. 
Here is my schema:
User-added image

Also as this is a custom controller, do I have to assign the Last Modified Date, Created By field values explicitly I can create a new booking record? I'm assuming nothing comes for free here? I'm not even sure what I'm suppose to put in those for those either. My primary hiccup is how do I assign the Availability and Client fields? Does that have to equal the Client.Name from the client object and Availability.Name from Availability Object?
 
<apex:page standardController="Booking__c" extensions="testing10" docType="html-5.0">
    <apex:form >
    	<apex:pageBlock >
        	<apex:pageBlockSection >
                <apex:pageBlockSectionItem >
                <apex:outputLabel >Booking Date</apex:outputLabel>
                <apex:inputfield value="{!Records.Start_Date_Time__c}">
                <apex:actionSupport action="{!UpdateSitter}" event="onchange" reRender="D1"/>   
           		</apex:inputfield>
	        </apex:pageBlockSectionItem>                 
                </apex:pageBlockSection>
            
            <apex:pageBlockSection columns="1" id="D1">
                 <apex:outputLabel rendered="{!FlagH}">Baby Sitters</apex:outputLabel>
                 <apex:selectList value="{!SelectedSitter}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                 <apex:selectOptions value="{!RecordOption}" rendered="{!FlagH}"/> 
                  </apex:selectList>
              
                  <apex:outputLabel rendered="{!FlagH}">Clients</apex:outputLabel>
                  <apex:selectList value="{!SelectedClient}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                  <apex:selectOptions value="{!ClientOption}" rendered="{!FlagH}"/> 
                  </apex:selectList>
                
                  <apex:outputLabel rendered="{!FlagH}">Number of Hours Needed</apex:outputLabel>
                  <apex:input type="number" id="hoursI" value="{!hours}" html-min="2" html-max="8" rendered="{!FlagH}"/      
                
              <apex:pageBlockTable value="{!Sdate}" var="sd" rendered="{!FlagH}">
                    <apex:column value="{!sd}"/>
                   <apex:column value="{!Record.End_Date_Time__c}"/>
             </apex:pageBlockTable>
                
              </apex:pageBlockSection>
              <apex:pageBlockButtons location="bottom">
	          <apex:commandButton action="{!save}" value="Save"/>
	          </apex:pageBlockButtons>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>

public class testing10 {
   public Booking__c Records{get;set;}
    public Boolean FlagH{get;set;}
    public Datetime DTime {get;set;}
    public List<SelectOption> RecordOption{get;set;} //stores the babysitters names in the picklist
    public Date PickDate{get;set;}
    public String Sdate{get;set;}
    public String SelectedSitter{get;set;}
    public String SelectedClient{get;set;}
    public List<SelectOption> ClientOption{get;set;} 
    public Integer hours{get;set;} 
  
 
    public PageReference UpdateSitter(){
  
      RecordOption = new List<SelectOption>();  //list to hold my babysitters returned 
      ClientOption = new List<SelectOption>(); //list to hold clients
        
        try{
          Dtime = Records.Start_Date_Time__c; //retrive datetime input 
          PickDate= DTime.date(); //convert datetime to date type
          Sdate = String.valueOf(PickDate);
          SelectedClient ='';
            
          RecordOption.add(new SelectOption('', '----Noness----'));
          ClientOption.add(new SelectOption('', '----Select Client----'));
            
          List<Availability__c> tempval = new List<Availability__c>([SELECT Id, Name, BabySitter__r.name, BabySitter__r.First_Name__c from Availability__c WHERE Date_Available__c =: PickDate and Booked__c=FALSE]);
          List<Client__c> tempClient = new List<Client__c>([SELECT Id, Name, First_Name__c, Last_Name__c from Client__c]);
            FlagH=false; //hides rendered block until returned date has an associated value (babysitters)
            if(tempval.size() > 0){  //babysitters are found
                FlagH=true;
                for(Availability__c a : tempval){
                    RecordOption.add(new SelectOption(a.Id, a.BabySitter__r.First_Name__c));
                }
               
                if (tempClient.size() > 0){
                      for(Client__c c : tempClient){
                    	ClientOption.add(new SelectOption(c.Id, c.Name));
                	}
				}
                
                //calculate end date/time
                Records.End_Date_Time__c = Records.Start_Date_Time__c + (hours/24);
                
                //assign client to new booking??????
                Records.Client__c = SelectedClient;
                
                //assign Availability/sitter?????????
                Records.Availability__r.Name = SelectedSitter;
              
            }
           
       
        }catch(Exception e){
            
        }    
       
        return null;
    }
    
    public PageReference save(){
        insert Records;
        //need to save booking with selected babysitter, selected date
        //update availability to booked (boolean)
        //return to listview page (parent page)
        return null;
    }
    public testing10(ApexPages.StandardController controller){
        FlagH = false;
        SelectedClient ='';
        SelectedSitter = '';
        Records = (Booking__c)controller.getRecord();
        
        
    }
    public testing10(){}
}

 
Hello there,
  I have a VF page with two selectList components. They should get re-rendered when I change my inputfield date. Any previously selected value in the selectList seems to reset for my first selectList but my second one still retains the previously selected value. I checked everywhere if I'm setting my rerender flag incorrectly, but no luck on finding the root cause. If someone can point me in a direction or can help me unblock this I would greatly appreciate it. Thanks in advance.
<apex:page standardController="Booking__c" extensions="testing10">
    <apex:form >
    	<apex:pageBlock >
        	<apex:pageBlockSection >
                <apex:pageBlockSectionItem >
                <apex:outputLabel >Booking Date</apex:outputLabel>
                <apex:inputfield value="{!Records.Start_Date_Time__c}">
                <apex:actionSupport action="{!UpdateSitter}" event="onchange" reRender="D1"/>   
           		</apex:inputfield>
			    </apex:pageBlockSectionItem>                
            </apex:pageBlockSection>
            
            <apex:pageBlockSection columns="1" id="D1">
               
                 <apex:outputLabel rendered="{!FlagH}">Baby Sitters</apex:outputLabel>
                 <apex:selectList value="{!SelectedSitter}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                 <apex:selectOptions value="{!RecordOption}" rendered="{!FlagH}"/> 
                    </apex:selectList>
              
                  <apex:outputLabel rendered="{!FlagH}">Clients</apex:outputLabel>
                 <apex:selectList value="{!SelectedClient}" size="1" rendered="{!FlagH}"> <!--var holding selected item-->
                 <apex:selectOptions value="{!ClientOption}" rendered="{!FlagH}"/> 
                    </apex:selectList>
                 
             
                
              <apex:pageBlockTable value="{!Sdate}" var="sd" rendered="{!FlagH}">
                    <apex:column value="{!sd}"/>
             </apex:pageBlockTable>
                
            </apex:pageBlockSection>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>

public class testing10 {
   public Booking__c Records{get;set;}
    public Boolean FlagH{get;set;}
    public Datetime DTime {get;set;}
    public List<SelectOption> RecordOption{get;set;} //stores the babysitters names in the picklist
    public Date PickDate{get;set;}
    public String Sdate{get;set;}
    public String SelectedSitter{get;set;}
    public String SelectedClient{get;set;}
    public List<SelectOption> ClientOption{get;set;} 
  
 
    public PageReference UpdateSitter(){
  
      RecordOption = new List<SelectOption>();  //list to hold my babysitters returned 
      ClientOption = new List<SelectOption>(); //list to hold clients
        
        try{
          Dtime = Records.Start_Date_Time__c; //retrive datetime input 
          PickDate= DTime.date(); //convert datetime to date type
          Sdate = String.valueOf(PickDate);
            
          RecordOption.add(new SelectOption('', '----Noness----'));
          ClientOption.add(new SelectOption('', '----Select Client----'));
            
          List<Availability__c> tempval = new List<Availability__c>([SELECT Id, Name, BabySitter__r.name, BabySitter__r.First_Name__c from Availability__c WHERE Date_Available__c =: PickDate and Booked__c=FALSE]);
          List<Client__c> tempClient = new List<Client__c>([SELECT Id, Name, First_Name__c, Last_Name__c from Client__c]);
            FlagH=false; //hides rendered block until returned date has an associated value (babysitters)
            if(tempval.size() > 0){  //babysitters are found
                FlagH=true;
                for(Availability__c a : tempval){
                    RecordOption.add(new SelectOption(a.Id, a.BabySitter__r.First_Name__c));
                }
                //expose client list
               
                if (tempClient.size() > 0){
                    //FlagH=true;
                      for(Client__c c : tempClient){
                    	ClientOption.add(new SelectOption(c.Id, c.Name));
                	}
				}
              
            }
           
       
        }catch(Exception e){
            
        }    
       
        return null;
    }
    public testing10(ApexPages.StandardController controller){
        FlagH = false;
        SelectedClient ='';
        SelectedSitter = '';
        Records = (Booking__c)controller.getRecord();
        
        
    }
    public testing10(){}
}



 
Hi Everyone,
 I'm trying a simple test
1. passing in a custom field (datetime) from my VF page to my apex controller.
2. take the datetime value passed and reassing it to a new datetime variable
3. convert datetime value in variable to string and have it re-rendered in my pagblocksection

When the action method is called, assigning that custom field datetime value seems to be throwing an exception. Pulling my hair out. Not sure where I've messed this up or misunderstood how this is suppose to work. Thanks in advance! 
 
<apex:page standardController="Booking__c" extensions="testing7">
    <apex:form>
        <apex:pageBlock>
        <apex:pageBlockSection>
            <apex:inputfield value="{!Records.Start_Date_Time__c}">
            <apex:actionSupport action="{!UpdateSitter}" event="onchange" reRender="D1"/>   
            </apex:inputfield>
        </apex:pageBlockSection>
            
        <apex:pageBlockSection columns="1" id="D1">          
            <apex:pageBlockTable value="{!Sdate}" var="sd" rendered="{!FlagH}">
            <apex:column value="{!sd}"/>
            </apex:pageBlockTable>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

public class testing7 {
    public Booking__c Records{get;set;}
    public String Sdate{get;set;}
    public Datetime DT{get;set;}
    public Boolean FlagH{get;set;}

    public PageReference UpdateSitter(){
        FlagH=true;
        try{ 
            DT = Records.Start_Date_Time__c;  //throwing an exception on this line
            Sdate=String.ValueOf(DT);
           }catch(System.NullPointerException e){
              Sdate='fail';
           }
        return null;
    }
    
    public testing7(ApexPages.StandardController controller)  {}
    
}