In our GP integration we have menus that should add to the Human Resources Transactions menu. I've tried this using both Dexterity and VS Tools for GP, but even though the menus successfully register they don't show up under the HR Transactions menu.
When i step through using visual studio, the only strange thing is that the root HR menu tag is a negative value, i'm not really sure what the means in the context, but i have never seen that type of behavior before.
The same code works for GP10 and GP2010 and it hasn't changed, so i'm really not sure what the issue is.
Any help would be appreciated, the code snippets for my C# addin is below.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Dexterity.Bridge;
using Microsoft.Dexterity.Applications;
namespace TimeCodeTransferMenus
{
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);
}
}
}
}