Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Want to enable or disbale a button on form based on a enum value

(0) ShareShare
ReportReport
Posted on by

Hi all, 

i want to enable/disbale a button on a from based on Enum value. but activate method was already used on the form. can someone please provide some information how to achieve this?

  • Suggested answer
    AliGul Profile Picture
    64 on at
    RE: Want to enable or disbale a button on form based on a enum value

    hi,

    you can always use form datasource active method for this logic and if you want to use this logic based on some specific condition then you can write your logic at the end of this method, means after all system's logic write your logic.

  • Suggested answer
    Xusheng Profile Picture
    on at
    RE: Want to enable or disbale a button on form based on a enum value

    Hi,

    Maybe you need merge the logic to the same method. Hope this can help you.

  • Nara Sheshananda Profile Picture
    on at
    RE: Want to enable or disbale a button on form based on a enum value

    Active method is used by other condition on the form.

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: Want to enable or disbale a button on form based on a enum value

    What do you mean by already used?

    If the button's enable/disable property is tied to a different condition, you need to review the code and combine the conditions.

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Want to enable or disbale a button on form based on a enum value

    Hi Nara Sheshu,

    where is this enum stored? Is it in the table that is shown on the form? If yes, then indeed the active method of the form data source is the correct place for triggering your code.

    What do you mean by "activate method was already used on the form"?

    Quite often there's a method called "updateDesign" on the form, and this method is called from the active method of the form data source. I recommend to do this - then the code is easy to read and maintain, and you don't clutter the active method with a lot of code.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,009 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans