on 01-27-2009 2:35 AM
Hello All:
I created a user menu to replace Sales Order menu. It does few things when user click on it original sales order menu does. But now I want to make the sales order menu 2050 invisible.. I don't see it in the menus object. But I can go into configuration thing and uncheck it. Is there a way programmatically to make the menu invisible?
Thank You!
You may hide menuitem for sales order as
Dim m_menus As SAPbouiCOM.Menus
Dim m_menuItem As SAPbouiCOM.MenuItem
m_menus = SBO_Application.Menus
m_menus = m_menus.Item("2048").SubMenus
m_menuItem = m_menus.Item("2050")
m_menuItem.Enabled = False
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use the FormPreferencesService object in the DI API to update the user's Form Settings for the main menu when your addon starts. However, I've found that the form settings don't take affect until the user logs out and then logs back in to SBO. Unfortunately, I can't find a workaround to this so the first time your users start the addon you'll need to instruct them to log out and then log back in.
private void HideSalesOrderMenu()
{
try
{
SAPbobsCOM.CompanyService sboService;
SAPbobsCOM.FormPreferencesService sboFormSettings;
SAPbobsCOM.ColumnsPreferences sboColPrefs;
SAPbobsCOM.ColumnsPreferencesParams sboColPrefParams;
sboService = _sboCompany.GetCompanyService();
sboFormSettings = (SAPbobsCOM.FormPreferencesService)sboService.GetBusinessService(SAPbobsCOM.ServiceTypes.FormPreferencesService);
sboColPrefParams = (SAPbobsCOM.ColumnsPreferencesParams)sboFormSettings.GetDataInterface(SAPbobsCOM.FormPreferencesServiceDataInterfaces.fpsdiColumnsPreferencesParams);
sboColPrefParams.FormID = "169"; // Main Menu
sboColPrefParams.User = _sboCompany.UserSignature;
sboColPrefs = sboFormSettings.GetColumnsPreferences(sboColPrefParams);
for (int i = 0; i < sboColPrefs.Count; i++)
{
if (sboColPrefs.Item(i).ItemNumber == "2050")
{
sboColPrefs.Item(i).VisibleInExpanded = SAPbobsCOM.BoYesNoEnum.tNO;
sboColPrefs.Item(i).VisibleInForm = SAPbobsCOM.BoYesNoEnum.tNO;
}
}
sboFormSettings.UpdateColumnsPreferences(sboColPrefParams, sboColPrefs);
}
catch (Exception ex)
{
_sboApp.SetStatusBarMessage("Error: " + ex.Message, SAPbouiCOM.BoMessageTime.bmt_Medium, true);
}
}
Kind Regards,
Owen
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.