Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Remove Custom Menu Item In Specific Company

(0) ShareShare
ReportReport
Posted on by 123
We have a custom GP Addin where a number of menu items are being added via the AddMenuHandler function.  However, these menu items are showing up in both of the client's GP companies and they want them to only display in a single GP company.   

Since there is no RemoveMenuHandler function available, is there another approach that can be taken with Visual Studio Tools for Dynamics GP to accomplish this?
Categories:
  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,947 Most Valuable Professional on at
    Remove Custom Menu Item In Specific Company
    There is no simple method of removing the VSTools equivalent of a Dexterity Form Menu Trigger used by the AddMenuHandler function.  You could write code that checks the company logged into and then applies the form menus, but that would not handle switching between companies or preventing it adding the menu multiple times.
     
    I would suggest that you add some code to the menu handling scripts that checks which company is active and displays a dialog and cancels when not needed.  It won't hide it from other companies but will stop it doing anything.
     
    FYI: If you used Dexterity or GP Power Tools to add the form menus, you would be able to enable and disable them dependent on which company you were logged into.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,431 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,503 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans