You need to sign in to do that
Don't have an account?
Muruganand_Sforce
How to Populate the datetime value using inputtext in VF
Hi,
I want to get(populate) a datetime input value from visual force page to custom controller. I can't use inputfield since it is not filed in any object.
suggest me...
You can convert a String to a date/time using the static parse method. As that requires quite a fixed format, you might want to consider providing picklists for the various components or integrating with 3rd party calendar picker.
Hi Bob,
I want to select from calender picker...Is it possible via java script?
Is this the standard date picker? You may be able to leverage this without an inputfield, but its a fragile solution as Salesforce may change the implementation at any time.
Something else you may wish to consider is to use a dummy sobject with a datetime field to capture the information, then extract it out of that before continuing your processing.
Yes...It is standard date picker
The easiest way is to instantiate an sobject with a DateTime field on it, and then use an inputfield. You don't have to save the sobject to the database, you simply use it as a carrier for the field.
I tried to do so....but got error....Can you give few lines of it...
In the controller:
in the page:
This assumes you have an sobject tpe MyObject__c with a Datetime field called Date_Time__c
I dont have sobject tpe MyObject__c with a Datetime field called Date_Time__c.
I should use only Inputtext not Inputfield.
I didn't expect you to have one.
Presumably you have some sobjects in your org and one of these has a date/time field? Just replace the sobject and field names with the actual details from your org. That way you can use an inputfield and avoid replicating the datepicker functionality.
Hi Bob,
I have finished the Task by writing JavaScript....Thanks for your Help.
No problem. Did you hook in to the existing datepicker or integrate with a 3rd party version?
please create Datetime field to use Datetime input in visualforce.
I Integrated with 3rd party version.
I am looking for something similar. I need to capture date value from visualforce page. Can you please post what solution you did with sample code.
Thanks