• JPsantos
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies

Hi.

 

I have a VF page that displays two date properties, which can be edited with the standard datepicker. I am setting these properties value to a default date but the when the page loads the text fields linked to them are showing me the dates formatted differently than what the datepicker is expecting (i guess?).

 

Controller:

public class slotMarcacaoController {
        
    public Date startDate { get; set; }
    public Date endDate { get; set; }
     
    public slotMarcacaoController(ApexPages.StandardController controller) {
        init();
    }
        
    public slotMarcacaoController (){
      init();
    }
    private void init(){
        startDate = Date.Today();
        endDate = startDate.addDays(7);        
    }
    
    public void reserveSlot(Integer index){
    
    }
    
    public PageReference refreshSlots(){
        //some code
        return null;
    }

    
    public Datetime lowerLimit {get; set;}
    public Datetime upperLimit {get; set;}
}

 

VF Page:

<apex:page standardController="Case" extensions="slotMarcacaoController" >

   <script type="text/javascript">
    
    window.onload=function() {
        focus('defaultFocus');     
    }
    
    function focus(id){
        document.getElementById(id).focus();
    }
  </script>
  
    <apex:form >
        <div>
            <span id="defaultFocus">Data Inicio</span>
            <apex:inputText style="position:relative; left:20px;" 
                label="Data Inicio" value="{!startDate}"
                onfocus="DatePicker.pickDate(true, this, true);" id="date1"> 
            </apex:inputText>
        </div>
        <div>
           <span>Data Fim</span>
           <apex:inputText style="position:relative; left:28px;"
               label="Data Fim" value="{!endDate}"
               onfocus="DatePicker.pickDate(false, this, false);" id="date2"/> 
        </div>
        <apex:commandButton action="{!refreshSlots}" value="Actualizar">
        </apex:commandButton>           
    </apex:form>
    
    <apex:outputText value="{!lowerLimit}"></apex:outputText><br/>
    <apex:outputText value="{!upperLimit}"></apex:outputText>
   
</apex:page>

After the page load the text fields for both dates are in the following format "Fri Feb 08 00:00:00 GMT 2013". When i choose the same date with the datepicker, they show it like "2/8/2013". How can i make it always display the date in the latter format? 

 

Thanks in advance.

Hi.

 

Is it possible to make assignment rules trigger on every insert/update ? I've made that PL checkbox checked by default, but if I edit a field "in place" (i.e. instead of opening the edit for, just d-click the field in the details page) the rule is not fired. 

 

Can I do this without APEX?

 

Thanks for the help.

Hi.

 

Using Dynamic Choices in Flows, is it possible to use OR statement in the filter? If it's not, what alternatives do I have to accomplish this behavior ?

 

Thanks for the help.

Hi.

 

Is it possible to make assignment rules trigger on every insert/update ? I've made that PL checkbox checked by default, but if I edit a field "in place" (i.e. instead of opening the edit for, just d-click the field in the details page) the rule is not fired. 

 

Can I do this without APEX?

 

Thanks for the help.