I have a datepicker on the form "datevalue1" based on a CDS column "Approx Close Date" and I have a datepicker on the form "datevalue2" based on a CDS column "Actual Close Date."
Both these columns are optional.
When a user submits the form initially, they would enter an approx close date in datevalue1 (and leaving datevalue2 empty)... and nearing the time it closes, they enter the actual close date in datevalue2.
What would be a good way to have the value in datevalue2 duplicated into datevalue1, but only when datevalue2 contains data?
I hope that makes some semblance of sense, thx!
Thanks so much @eka24
I am still trying to understand your suggestion.
If I set the Default Date of the Date Picker to
If(Form1.Mode=FormMode.New,Blank(), Parent.Default)
The parent of this Date Picker is the Card, and its Default is set to
ThisItem.'Approx Close'
Would that not already create a blank new record when the form mode is new? Or is there another reason why On Change of the Date Picker should also be set to
If(Form1.Mode=FormMode.New,Blank(), Parent.Default)
Apologies for my slowness, thx!
If there is a defauldate, then it cannot be blank. So look at the formula again.
If that should work, on Change the default date to;
If(Form1.Mode=FormMode.New,Blank(), Parent.Default)
Then you can use your formula stated.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Both datepickers DefaultDate is Parent.Default
Does the following code for DefaultDate in Date Picker DateValue1 seem like it would work:
If(!IsBlank(DateValue2),DateValue2.SelectedDate,Parent.Default)
What I am hoping it would do, is allow any date to be selected so long as DateValue2 is empty (whether the form mode is new, or edit)... and if DateValue2 has a date, that it would enter that date in DateValue1
Thanks so much!
Am assuming that both datepickers DefaultDate is Blank(). If that is the case try this code in the DafaultDate of Datepicker2;
If(Form1.Mode = FormMode.New && !IsBlank(DatePicker1), DatePicker1.SelectedDate)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.