Skip to main content

Notifications

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 37
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
  • Dinesh Tyagi Profile Picture
    Dinesh Tyagi 37 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
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 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
    Dinesh Tyagi 37 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
    Dinesh Tyagi 37 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
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 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
    NikolajSorensen 1,728 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
    GirishS 27,821 Super User 2024 Season 1 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans