Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Menus for VS Tools not creating menu in Human Resources

Posted on by Microsoft Employee

I'm trying to create a new menu in GP2013 using Menus For Visual Studio Tools. The menu code in the GP addin fires properly and it creates the menu tags, however the menu tags for the parent Human Resources Transactions menu is coming back as a negative value. This code works for previous versions of GP (2010 and GP10), but now it doesn't work.

How do i resolve this issue?

The code for the menu creation is below, any advice would be very much appreciated.

public class GPAddIn : IDexterityAddIn

   {

       // IDexterityAddIn interface

       short HRTrxMenuTag;

       short TimeCodeMenuTag;

       short MassTimeCodeMenuId;

       public void Initialize()

       {

           MenusForVisualStudioTools.Functions.EventRegister.InvokeAfterOriginal += new Microsoft.Dexterity.Applications.MenusForVisualStudioToolsDictionary.EventRegisterFunction.InvokeEventHandler(EventRegister_InvokeAfterOriginal);

           MenusForVisualStudioTools.Functions.EventHandler.InvokeAfterOriginal += new Microsoft.Dexterity.Applications.MenusForVisualStudioToolsDictionary.EventHandlerFunction.InvokeEventHandler(EventHandler_InvokeAfterOriginal);

       }

       void EventHandler_InvokeAfterOriginal(object sender, Microsoft.Dexterity.Applications.MenusForVisualStudioToolsDictionary.EventHandlerFunction.InvokeEventArgs e)

       {

           if (e.inParam1 == TimeCodeMenuTag)

           {

               Microsoft.Dexterity.Applications.CogsdaleCsm.Forms.UmUprTimeCodeTransfer.Open();

           }

           if (e.inParam1 == MassTimeCodeMenuId)

           {

               Microsoft.Dexterity.Applications.CogsdaleCsm.Forms.UmUprTimeCodeMassTransfer.Open();

           }

           //throw new NotImplementedException();

       }

       void EventRegister_InvokeAfterOriginal(object sender, Microsoft.Dexterity.Applications.MenusForVisualStudioToolsDictionary.EventRegisterFunction.InvokeEventArgs e)

       {

           //throw new NotImplementedException();

           HRTrxMenuTag = MenusForVisualStudioTools.Functions.GetTagByName.Invoke(0, "CL_HumanResources_Transactions", "Command_System");

           if (HRTrxMenuTag != 0)

           {

               TimeCodeMenuTag = MenusForVisualStudioTools.Functions.Register.Invoke(HRTrxMenuTag, "Time Code Transfer", "Time Code Transfer", 0, 0, false, false, false, HRTrxMenuTag, false, false);

               MassTimeCodeMenuId = MenusForVisualStudioTools.Functions.Register.Invoke(HRTrxMenuTag, "Time Code Mass Transfer", "Time Code Mass Transfer", 0, 0, false, false, false, HRTrxMenuTag, false, false);

           }

       }

   }

*This post is locked for comments

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans