Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Customize menu not showing in GP 2015

(0) ShareShare
ReportReport
Posted on by 615

Hi all ,

Actually when i merge our cnk file into gp our customized form is showing but our customize menu is not appear and  in development mode show my customize menu .so please any one know that how can resolve this problem.

Please help me i m new in GP 15.

Thanks & Regards,

Govind Devda

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Customize menu not showing in GP 2015

    Thanks, I missed that part. It worked perfect!!

  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RE: Customize menu not showing in GP 2015

    Hi Ben

    You have the same issue. Your last AddCommandToMenu() call is using DYNAMICS with form Command_Ben when it should be dictid.

    This might worked before due to a bug in Dexterity, but does not work anymore when incorrectly defined as it currently is.

    David

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Customize menu not showing in GP 2015

    Hi all,

    I have a similar issue, my menus work perfectly when in test mode but when I deploy the chunk it does not show. No errors,  just not showing. I have created a new development where I have a basic window with a button and tried to add it to the Financial Setup menus. Again, works in test mode but as soon as I deploy it does not show. I can access the window if I add it as a shortcut. Here is my code if you could please have a look.


    in integer LoadMode;
    optional in boolean ShowProgress;

    local CmdSequence Seq;
    local integer Status;
    local boolean AddMenuItems;

    local integer dictId;

    dictId = Runtime_GetCurrentProductID();

    AddMenuItems = true;


    if LoadMode = MENULOAD_TOTABLE then
    if MenusExistForProduct(Runtime_GetCurrentProductID()) of form syMenuObj = true then
    AddMenuItems = false;
    end if;
    end if;


    if AddMenuItems = true then
    {Add a separator, which is a built-in command}
    Seq = 0;
    Status = AddCommandToMenu(DYNAMICS,
    resourceid(form Command_Financial),
    resourceid(command CL_Financial_Setup of form Command_Financial),
    Seq,
    CMD_BUILTINCMD_DICTID,
    CMD_BUILTINCMD_FORMID,
    resourceid(command cmdSeparator),
    true,
    LoadMode);
    if Status <> OKAY then
    error "Could not add separator item.";
    end if;


    Seq = 0;
    Status = AddCommandToMenu(DYNAMICS,
    resourceid(form Command_Financial),
    resourceid(command CL_Financial_Setup of form Command_Financial),
    Seq,
    dictId,
    resourceid(form command_Ben),
    resourceid(command BENTEST of form command_Ben),
    true,
    LoadMode);
    if Status <> OKAY then
    error "Could not add.";
    end if;


    Seq = 0;
    Status = AddCommandToMenu(DYNAMICS,
    resourceid(form command_Ben),
    resourceid(command BENTEST of form command_Ben),
    Seq,
    dictId,
    resourceid(form command_Ben),
    resourceid(command BENTESTWINDOW of form command_Ben),
    true,
    LoadMode);
    if Status <> OKAY then
    error "Could not add.";
    end if;
    end if;

    Regards,

    Ben

  • GovindDevda Profile Picture
    GovindDevda 615 on at
    RE: Customize menu not showing in GP 2015

    Yes David its working, Thank you so much !!

    Regards,

    Govind

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RE: Customize menu not showing in GP 2015

    Hi Almas

    That code is a little round about but it would do what he wanted.  Basically, if I am in test mode, then use dictionary 0.

    In the updated code I suggested, I removed the use of the swDC_PROD_ID variable entirely anyway.

    David

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RE: Customize menu not showing in GP 2015

    Hi Govind

    I am assuming the updated code is working for you. :-)

    David

  • Almas Mahfooz Profile Picture
    Almas Mahfooz 11,006 User Group Leader on at
    RE: Customize menu not showing in GP 2015

    David I was asking this to Govind because of his below part of code, to check if he is correctly setting his product id. :)

        if Runtime_GetCurrentProductID() = DYNAMICS then
         
        swDC_PROD_ID = DYNAMICS;
         
        end if;
    
    
  • GovindDevda Profile Picture
    GovindDevda 615 on at
    RE: Customize menu not showing in GP 2015

    OMG !!! Hearty Thank you so much David Sir for guide me really, i appreciate you.

    Again thank you !!

    Regards ,

    Govind Devda

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RE: Customize menu not showing in GP 2015
    in       integer     LoadMode; { create data or just load menus to memory }
    optional in boolean     ShowProgress = false;
    
    local CmdSequence Seq;
    local integer Status;
    local boolean AddMenuItems;
    
    {Set the flag indicating that menu items should be added}
    pragma(disable warning LiteralStringUsed);
    
    AddMenuItems = true;
    
    if LoadMode = MENULOAD_TOTABLE then
    	{Find out whether the menu items exist in the Menu Master table.}
    	if Runtime_GetCurrentProductID() = DYNAMICS or
    			MenusExistForProduct(Runtime_GetCurrentProductID()) of form syMenuObj = true then
    		{Do not need to add the menu items}
    		AddMenuItems = false;
    	end if;
    end if;
    
    if AddMenuItems = true then
    	Seq = 0;
    	Status = AddCommandToMenu(	DYNAMICS,
    								resourceid(form Command_System),
    								resourceid(command CL_Cards  of form Command_System),    
    								Seq, 
    								CMD_BUILTINCMD_DICTID,
    								CMD_BUILTINCMD_FORMID, 
    								resourceid(command cmdSeparator), 
    								true, 
    								LoadMode);
    	if Status <> OKAY then
    		error "Could not add separator item.";
    	end if; 
    
    	Seq = 0;
    	Status = AddCommandToMenu(	DYNAMICS,
    								resourceid(form Command_System),
    								resourceid(command CL_Cards  of form Command_System), 
    								Seq,
    								Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_CARDS),
    								resourceid(command DC_MENU_CARDS of form DC_MENU_CARDS),
    								true,
    								LoadMode);
    	if Status <> OKAY then
    		error "Could not add command Data_Core_Customization";
    	end if;
    
    	Seq = 1;
    	Status = AddCommandToMenu(	Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_CARDS),
    								resourceid(command DC_MENU_CARDS of form DC_MENU_CARDS),
    								Seq,
    								Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_CARDS),
    								resourceid(command JobCodeMaintenance of form DC_MENU_CARDS),
    								true,
    								LoadMode);
    	if Status <> OKAY then
    		error "Could not add command Job_Code_Maintenance.";
    	end if;   
    
    	Seq = 2;
    	Status = AddCommandToMenu(	Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_CARDS),
    								resourceid(command DC_MENU_CARDS of form DC_MENU_CARDS),
    								Seq,
    								Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_CARDS),
    								resourceid(command 'DC_ServiceCode' of form DC_MENU_CARDS),
    								true,
    								LoadMode);
    
    	if Status <> OKAY then
    		error "Could not add command FOB_CODE_Maintenance.";
    	end if; 
    
    end if;
    
    if AddMenuItems = true then
    	{-- Add the Lead Maintenance item to the Cards>>Payroll Dynamics submenu--}
    	{Add a separator, which is a built-in command}
    	Seq = 0;
    	Status = AddCommandToMenu(	DYNAMICS,
    								resourceid(form Command_System),
    								resourceid(command CL_Setup  of form Command_System),    
    								Seq, 
    								CMD_BUILTINCMD_DICTID,
    								CMD_BUILTINCMD_FORMID, 
    								resourceid(command cmdSeparator), 
    								true, 
    								LoadMode);
    	if Status <> OKAY then
    		error "Could not add separator item.";
    	end if;
    
    	Seq = 0;
    	Status = AddCommandToMenu(	DYNAMICS,
    								resourceid(form Command_System),
    								resourceid(command CL_Setup  of form Command_System), 
    								Seq,
    								Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_SETUP),
    								resourceid(command DC_MENU_SETUP of form DC_MENU_SETUP),
    								true,
    								LoadMode);
    	if Status <> OKAY then
    		error "Could not add command DATA_Core_Customization";
    	end if;
    
    	Seq = 1;
    	Status = AddCommandToMenu(	Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_SETUP),
    								resourceid(command DC_MENU_SETUP of form DC_MENU_SETUP),
    								Seq,
    								Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_SETUP),
    								resourceid(command StateMaintenance of form DC_MENU_SETUP),
    								true,
    								LoadMode);
    	if Status <> OKAY then
    		error "Could not add command State_Maintenance.";
    	end if;
    
    	Seq = 2;
    	Status = AddCommandToMenu(	Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_SETUP),
    								resourceid(command DC_MENU_SETUP of form DC_MENU_SETUP),
    								Seq,
    								Runtime_GetCurrentProductID(),
    								resourceid(form DC_MENU_SETUP),
    								resourceid(command DC_SQLOBJECT of form DC_MENU_SETUP),
    								true,
    								LoadMode);
    	if Status <> OKAY then
    		error "Could not add command SQL Object Maintenance.";
    	end if;
    
    end if;
    
    pragma(enable warning LiteralStringUsed);
  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RE: Customize menu not showing in GP 2015

    Hi Govind

    There was a bug in Dexterity that caused the Command_GetTag() function to work incorrectly in a multidictionary environment. The side effect of the bug was that malformed menu definitions would work. Now that the bug is fixed you MUST have your menu code correct.

    blogs.msdn.com/.../quick-tip-getting-command-based-menus-working-in-dexterity.aspx

    I can see multiple issues with your code:

    1) Everywhere that you are using the form DC_MENU_SETUP in the  AddCommandToMenu function, you should be using Runtime_GetCurrentProductID().

    2) Not all of the commands are inside the if AddMenuItems = true then condition.

    3) The check if LoadMode = MENULOAD_TOTABLE then should return false when running in test mode, so it does not add the menus to the tables while in test mode.

    I will post a fixed version of your script.

    David

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…

Vahid Ghafarpour – Community Spotlight

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

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,317 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans