The AlreadExistsOnMenu() function defined in the syMenuObj form is provided by Microsoft Dynamics GP so you can easily determine whether a command or command list is part of an existing menu.
AlreadyExistsOnMenu(UserID, ParentDictID, ParentFormID, ParentCmdID, CmdDictID, CmdFormID, CmdID {,Sequence})
• UserID – A string that specifies which user’s set of menus will be examined to find out whether the menu item exists. Specify the empty string ("") to examine the default set of menus.
• ParentDictID – The ID of the dictionary that contains the command list (menu or submenu) that is being examined. Use the constant DYNAMICS to specify the Microsoft Dynamics GP main dictionary.
• ParentFormID – The resource ID of the command form that contains the definition of the command list that is being examined.
• ParentCmdID – The resource ID of the command list that is being examined.
• CmdDictID – The ID of the dictionary that contains the command whose existance is being examined.
• CmdFormID – The resource ID of the command form that contains the definition of the command whose existance is being examined.
• CmdID – The resource ID of the command whose existance is being examined.
• Sequence – An optional integer variable that can be used to retrieve the sequence of the item in the command list, if the item exists. The value 0 indicates the item does not exist.
The function returns a boolean. The value true indicates the command already exists on the menu, while the value false indicates it does not.