web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / enum value was expected
Power Apps
Unanswered

enum value was expected

(1) ShareShare
ReportReport
Posted on by 691

Hello,

I tried a condition on a button's "DisplayMode" property, but I got the error "enum value was expected". But I need to do my comparison based on date as the code shows. Can you help me please? Thanks in advance


If(
    First(Collection_Dates_De_Saisie).'Fin de mois' = "Avant";
    Date(Year(Now()); Month(Now()) + 1; 01 -  Int(First(Collection_Dates_De_Saisie).'Fin Révision')) <= Today();

    Date(Year(Now()); Month(Now()) + 1; Int(First(Collection_Dates_De_Saisie).'Fin Révision'));
    DisplayMode.Disabled;
    DisplayMode.Edit
        )
Categories:
I have the same question (0)
  • Verified answer
    mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @s44 

     

    can u try this insteas:

    If(
     First(Collection_Dates_De_Saisie).'Fin de mois' = "Avant",
     If(
     Date(Year(Now()), Month(Now()) + 1, 01 - Int(First(Collection_Dates_De_Saisie).'Fin Révision')) <= Today(),
     DisplayMode.Disabled,
     DisplayMode.Edit
     ),
     If(
     Date(Year(Now()), Month(Now()) + 1, Int(First(Collection_Dates_De_Saisie).'Fin Révision')) <= Today(),
     DisplayMode.Disabled,
     DisplayMode.Edit
     )
    )
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • Hii_iii Profile Picture
    691 on at

    Hey @mmbr1606 
    Thanks it's work !!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard