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

Code for disabling action pane button

(0) ShareShare
ReportReport
Posted on by 80

Hi all..

Can anyone help me to get the code for disabling action pane button only for a particular user. 

If manage is the button I want to disable it for testUser.

Can you please suggest me a link or provide the code?

Regards

Vidhus.

  • ergun sahin Profile Picture
    8,816 Moderator on at
    RE: Code for disabling action pane button

    Being a standard form does not change the logic of development (If it is not command button or listpage form). You just have to write the code in CoC and use the extension to change the form property.

    In the other thread, friends described how to do it with security objects.

    I also think that code should not be written, but if you say how to do it with code, as I described above.

  • André Arnaud de Calavon Profile Picture
    294,157 Super User 2025 Season 1 on at
    RE: Code for disabling action pane button

    For more background on this question, see the other question from Vidhushan: community.dynamics.com/.../1188529

  • Vidhushan S Profile Picture
    80 on at
    RE: Code for disabling action pane button

    Hi Sahin.

    Thank you for your response.

    Yes it's not a custom form.

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: Code for disabling action pane button

    I don't know why you don't manage it with security objects, but if you want to do it with code (I assume it's a Custom form. Otherwise you have to do it with extensions);

    Set the button's autoDeclaration property to yes and in the init method of the form ;

    Button.enabled(CurUserId() != "testUser");

    If you do not want to make hardCode, you can make a table and save the users who will be disabled in this table.

    Note: If the active passive status of the button is calculated by the code, you need to add the user control to all the codes

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,157 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,930 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans