+ 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!