• mldv
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi everyone,

 

I'm pretty new to the Salesforce enviroment and even more with Visualforce pages. I'm trying to make an edit page of one of my objects but I want to customize with a button how the values will be assigned.

 

For example I have to make like a Time Allocation process where I was thinking on having two Datetime inputs one for Start and one for Exit. And that I can with a click of the Start button assign the current time to the respective Datetime field. Also being able to save it and the next time I access that objects record my Start button be Disabled and my Stop button enabled. So that I can click stop and obtain the current time on the Exit Datetime field. Something like this is what I have, which is only the fields and buttons.

 

Atleast I wanna know how and if I can obtain and assign values to inputFields, and if I can make them un editable when I want to.

 

<apex:page standardController="Time__c" showHeader="true" tabStyle="Time__c" >
  <apex:form >
  <apex:pageBlock title="Time">
    <apex:pageBlockSection columns="1">
      <apex:inputField id="tStart" value="{!Time__c.Start__c}" />
      <apex:inputField id="tFinish" value="{!Time__c.Finish__c}"/>
      <apex:inputField id="tCase" value="{!Time__c.Caso__c}" />
      <apex:commandButton action=" " value="Start"/>

      <apex:commandButton action="" value="Finish"/>

    </apex:pageBlockSection>
   
    <apex:pageBlockButtons >
      <apex:commandButton action="{!save}" value="Save"/>
      <apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>
    </apex:pageBlockButtons>
 
  </apex:pageblock>
  </apex:form>
</apex:page>

  • August 04, 2011
  • Like
  • 0