web
You’re offline. This is a read only version of the page.
close
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.

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
    301,231 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 384 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans