Hi @Anonymous
You have the right approach. However, in your if statement you are just asking if ThisItem.ID is true or false. In other words, if ThisItem.ID isn't empty, it is true. And since ThisItem.ID is probably always true, it will just keep in the DisplayMode.Edit.
So, if you want to change the DisplayMode of your save icon based on your datepicker, you could do as follows:
- On the OnChange property of your datepicker, set it to UpdateContext({lclDateChanged: true})
- On the DisplayMode property of your Save Icon, change it to
If(lclDateChanged,DisplayMode.Edit,DisplayMode.View)​
- Once submitting the form, you should reset the lclDateChanged variable again. To do that, you could add the following line to the OnSelect property of your Save button
UpdateContext({lclDateChanged:false});​
I hope this helps.
Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.