cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrstian89
Helper IV
Helper IV

DatePicker .SelectedDateFill

Hi!
I inherited an app in our company which uses OnStart to set different color schemes.

There is one error throughout the app on all DatePicker controls:

 

Name isn't valid. 'Datepicker' isn't recognized.

Location: Date_Pick
.SelectedDateFill

I cannot seem to find .SelectedDateFill anywhere within the code for any of the DatePickers.

 

I have this in the OnStart:

Set(
        DatePicker,
        {
            SelectedDateFill: Colors.MossGreen,
            IconBackground: Colors.MossGreen,
            IconFill: Colors.White,
            CalendarHeaderFill: Colors.MossGreen
        }

If I remove all or parts of this code, the issue still remains on all the DatePickers.

Even if I add new Date inputs, they all come with the same error.

 

  • Any suggestions on how to fix this error?
  • Is there an external style file somehow?
  • How are all new inputs created with the correct colors scheme?
    • I have tried to use the OnStart code in a separate app, but when i insert a new control, the item is generated with the standard Power Apps colors.
1 ACCEPTED SOLUTION

Accepted Solutions

@mrstian89 ,

It is interesting what a bit of searching does - this video and this accompanying web post might be what has happened here (I have never seen or heard of this function and am interested if this is the issue)

 

 

View solution in original post

8 REPLIES 8
AhmedSalih
Super User
Super User

Hi @mrstian89, the OnStart is going to retire and it is properly turned off in your app settings:

AhmedSalih_0-1656941457933.png

 

Use the new App property called StartScreen

AhmedSalih_1-1656941518351.png

For this property, type the name of the screen you want to be the first screen in your app

Then, paste your variable definition in the OnVisible property of that screen. 

Set(
        DatePicker,
        {
            SelectedDateFill: Colors.MossGreen,
            IconBackground: Colors.MossGreen,
            IconFill: Colors.White,
            CalendarHeaderFill: Colors.MossGreen
        }

AhmedSalih_2-1656941653162.png

 

To test, click on the 3 dots next to your App and Click Navigate to Start Screen

AhmedSalih_3-1656941871207.png

 

 

 

Regards,
Ahmed
If my reply helped you, please give a 👍. And if it has solved your issue, please consider Accepting it as the Solution to help other members of the community find it more.

 

Thanks for the reply! This setting is enabled and is not part of the issue, the OnStart is running fine (there is a lot more going on there).

 

My question is regarding the DatePicker.SelectedDateFill.

AhmedSalih
Super User
Super User

@mrstian89, one thing I noticed is you are getting this 

Name isn't valid. 'Datepicker' isn't recognized.

error because your code here missing a bracket at the end 

Set(
DatePicker,
{
SelectedDateFill: Colors.MossGreen,
IconBackground: Colors.MossGreen,
IconFill: Colors.White,
CalendarHeaderFill: Colors.MossGreen
} )

 

Thanks again for the reply. 🙂 This is due to bad copy/paste skills on my part. There is no actual issue with the OnStart code, the bracket is there.

 

Some how all the date picker inputs in the app has an error due to SelectedDateFill, which isn't actually a property one can set. It does not help to remove it from the OnStart, and there is no trace of it in the visible Date picker properties/settings. Is it possible that this app was created like some kind of theme, and that the reference to SelectedDateFill is there? How can I find it?

WarrenBelz
Super User
Super User

Hi @mrstian89 ,

As you have noted, a Date Picker does not have this property, however where are you getting the error on the controls if there is nowhere to apply the Variable to?

Very strange! Is there somehow a background file/settings with theme data? Any item I input is automatically inserted with correct colors/borders/settings. This cant only be due to the OnStart colors, can it? 

@mrstian89 ,

It is interesting what a bit of searching does - this video and this accompanying web post might be what has happened here (I have never seen or heard of this function and am interested if this is the issue)

 

 

Thanks! This must be what happened here! And it looks like there is no way to resolve the errors on the date pickers in this app, since these changes seems to have to be made the first time an app is imported/created!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,941)