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

How to predefault values on fields?

How do you predefault values on fields (example: set due date on task to current date). I tried this with a trigger, but the issue is the value does not populate as soon as new is clicked (even with before insert). It is filled in only on save.


You can create a custom button that calls an S-Control with a return URL with the fields pre-populated.  For instance, you can use the below URL to create a contact with the Address information from the Account pre-populated in the Contact edit page:


In the field properities why not set the Default value to TODAY()  .. this will achieve your goal.
Mark S.ax344Mark S.ax344
But this will only work on Custom Field correct?  Standard fields don't have an option to set a default value.
You are correct about the custom fields only supporting the default value..
Another option is an s-control with javascript that does some ajax to lookup the value and populate the field.  It can be done..
jyoti - I tried that in every possible way I could - to no avail.

Hi Dave,  Do you want to post your URL string so we can take a look?  You may need to put the date in a variable and pass that to the URL.