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
Abhilash MAbhilash M 

how to set default values of date fields

i have three fieldson a form,- start date , end date , due date . All these three fields are present on a  form component .
When I open the Lightning app i need to see these fields with default values.

default values  are

start date  is todays date

end date is todays date +30  days

due date is  start date +1 day

please help me

Do you have a custom controller for this?  If so you can just preset the values in the controller.  Otherwise you should be able to set the value of the fields to today() or today() + 30, etc.
Deepthi BDeepthi B
Hello Karthikeya,

Otherwise you can create formula fields for these 3 fields. So that they will populate automatically.
Formala Field 1: Start_Date__c = Today()
Formula Field 2: End_date__c=  Start_Date__c + 30
Formula Field 3: Due_Date__c = Start_Date__c+1

Hope this helps you!