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

Announcements

News and Announcements icon
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.

I have the same question (0)
  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    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

  • Vidhushan S Profile Picture
    80 on at

    Hi Sahin.

    Thank you for your response.

    Yes it's not a custom form.

  • André Arnaud de Calavon Profile Picture
    305,519 Super User 2026 Season 1 on at

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

  • ergun sahin Profile Picture
    8,826 Moderator on at

    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.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 635 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 595 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 557

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans