I'm trying to migrate some older customized forms from GP 6 to GP10 and having a problem getting the startup scrip to add a menu.
The original code was as follows:
Well that doesn’t work any longer in GP 10 because Trigger_RegisterForm no longer exists so I tried the following:
if AddMenuItems = true then
{-- Add the Lead Maintenance item to the Cards>>Sales submenu--}
{Add a separator, which is a built-in command}
Seq = 0;
Status = AddCommandToMenu(DYNAMICS,
resourceid(form Command_Sales),
resourceid(command CL_Sales_Cards of form Command_Sales),
Seq,
3334, {Custom Dic}
resourceid(form Style_Eyes_Main_Menu), {Custom Form}
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_Sales),
resourceid(command CL_Sales_Cards of form Command_Sales),
Seq,
3334, { this is the ID of my Custom Dictionary}
resourceid(form Style_Eyes_Main_Menu), {Custom Form}
resourceid(command Form_Open of form Style_Eyes_Main_Menu),
true,
LoadMode);
if Status <> OKAY then
error "Could not add Main_Menu command CL_Sales_Cards. Status = " + str(Status) +" ";
end if;
end if;
When it runs I get the message “Could not add separator item”. And “Could not add Main_menu command CL_SALES_CARDS. Status = 1”.
Tried everything and out of ideas.
Any help would be appreciated.
The original code was as follows:
local integer l_result.
local string l_translate.
{---------------------------------------------------------------
This form trigger enables the "Extras" menu when you display the Dynamics Customer Maintenance window.
----------------------------------------------------------------}
set l_result to Trigger_RegisterForm(form Cards_Financial_Palette,
"Study List Application", "", script Study_List_Setup_Window).
if l_result<>SY_NOERR then
warning "Form trigger registration failed.".
if l_result=LOCKED then
warning "This recrod has been locked".
else
warning "This error came from the Startup Script".
end if.
end if.
local string l_translate.
{---------------------------------------------------------------
This form trigger enables the "Extras" menu when you display the Dynamics Customer Maintenance window.
----------------------------------------------------------------}
set l_result to Trigger_RegisterForm(form Cards_Financial_Palette,
"Study List Application", "", script Study_List_Setup_Window).
if l_result<>SY_NOERR then
warning "Form trigger registration failed.".
if l_result=LOCKED then
warning "This recrod has been locked".
else
warning "This error came from the Startup Script".
end if.
end if.
Well that doesn’t work any longer in GP 10 because Trigger_RegisterForm no longer exists so I tried the following:
if AddMenuItems = true then
{-- Add the Lead Maintenance item to the Cards>>Sales submenu--}
{Add a separator, which is a built-in command}
Seq = 0;
Status = AddCommandToMenu(DYNAMICS,
resourceid(form Command_Sales),
resourceid(command CL_Sales_Cards of form Command_Sales),
Seq,
3334, {Custom Dic}
resourceid(form Style_Eyes_Main_Menu), {Custom Form}
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_Sales),
resourceid(command CL_Sales_Cards of form Command_Sales),
Seq,
3334, { this is the ID of my Custom Dictionary}
resourceid(form Style_Eyes_Main_Menu), {Custom Form}
resourceid(command Form_Open of form Style_Eyes_Main_Menu),
true,
LoadMode);
if Status <> OKAY then
error "Could not add Main_Menu command CL_Sales_Cards. Status = " + str(Status) +" ";
end if;
end if;
When it runs I get the message “Could not add separator item”. And “Could not add Main_menu command CL_SALES_CARDS. Status = 1”.
Tried everything and out of ideas.
Any help would be appreciated.