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);