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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to disable System defined Open in Excel menu button on a particular form

(0) ShareShare
ReportReport
Posted on by 61
Hi,
I want to disable Open in Excel Button which is system defined button. need to do it on a particular form like custTable or vendTable.
their is some code written over there in custTable but not getting how to execute. 
 
Thanks,
Dinesh
I have the same question (0)
  • Dinesh Tyagi Profile Picture
    61 on at
    How to disable System defined Open in Excel menu button on a particular form
    Hi Andre,
    Thanks for your reply, your suggested solution works perfectly fine.
     
    Thanks, 
    Dinesh
  • Verified answer
    André Arnaud de Calavon Profile Picture
    298,193 Super User 2025 Season 2 on at
    How to disable System defined Open in Excel menu button on a particular form
    Hi Dinesh,
     
    You don't need to extend privileges. You need to ensure you have security roles with duties that does not contain this specific privilege. Prevent changing standard security objects. It would be better to create and manage your own if you need different behavior compared to the standard roles.
  • Dinesh Tyagi Profile Picture
    61 on at
    How to disable System defined Open in Excel menu button on a particular form
    Hi Nikolaj & Andre,
    I checked their is one security privileges which contains customerEntity, customerEntityV2 & customerEntityV3. But can't extend the privilege to remove these entities from its permissions. So can you pls clear how can I do that.
     
    Thanks & Regards,
    Dinesh
     
  • Dinesh Tyagi Profile Picture
    61 on at
    How to disable System defined Open in Excel menu button on a particular form
    Hi Girish,
    I have tried this way but getting error: object reference not set to an instance of an object. That officeButton is null.
     
    [ExtensionOf(FormStr(CustTable))]
        public void init()
        {
         FormCommandButtonControl officeButton;
            #SysSystemDefinedButtons
            next init();
            officeButton = this.control(this.controlId(#SystemDefinedOfficeButton)) as FormCommandButtonControl; 
            officeButton.visible(false); 
        }
     
    Thanks,
    Dinesh
  • Verified answer
    André Arnaud de Calavon Profile Picture
    298,193 Super User 2025 Season 2 on at
    How to disable System defined Open in Excel menu button on a particular form
    Hi Dinesh,
     
    I agree with Nikolaj. You can manage which entities are visible for used in 'Open in Excel' with help of security. In case you remove the data entities currently listed from their permissions, the list with options for Open in Excel will be empty. Note that Export to Excel will be then still visible. 
  • Suggested answer
    NikolajSorensen Profile Picture
    1,784 on at
    How to disable System defined Open in Excel menu button on a particular form
    This should be controlled by the security configuration.
     
    Access to the entities defines if users are able to interact with the data through functions such as "Open in Excel".
    You will need to modify or build new security roles, where you simply do not grant access to the entities in question.
  • Suggested answer
    GirishS Profile Picture
    27,825 Moderator on at
    How to disable System defined Open in Excel menu button on a particular form in D365FO
    Hi Dinesh,
     
    I think with the help of "SysSystemDefinedButtons" macro you can hide the System defined buttons.
    For open in excel the button name is "SystemDefinedOfficeButton".
    Refer to the below Microsoft documentation for disabling system defined buttons through code.
    You can refer to the last section in the above link.
     
    Thanks,
    Girish S.
     

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 895

#2
Sohaib Cheema Profile Picture

Sohaib Cheema 811 User Group Leader

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans