function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amita TatarAmita Tatar 

populating date field through URL in VF page

Hi all,

I have a standard date field in VF page. When i redirect to this URL i want to pass the date through the URL and set date as default value. How to do that. Please help

Amita
Uvais KomathUvais Komath

http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html

Its called URL hacking. 

Inspect the page (Right click on page > Inspect)

Find id of the input field 

Then add the following in your URL

&<Field ID HERE>={!Object.DatefieldName}

Amita TatarAmita Tatar
Hi Uvais,

But how do i put there today's date?
 
Uvais KomathUvais Komath
Use {!$System.Today()} instead of {!Object.DatefieldName}
Vivek DVivek D
Hi

Try this
// In Javascript
var myDateParameter = '{!$currentpage.parameters.circularno}';

var s = document.getElementById('{!$Component.myInputFieldId}');
 s.value = myDateParameter ;