Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Tuned Listener
Posts: 27
Registered: ‎01-27-2010

Re: Problem hiding tabs at runtime Web 7.5.4

I agree....is there any other options?
Bronze Super Contributor
Posts: 177
Registered: ‎04-27-2009

Re: Problem hiding tabs at runtime Web 7.5.4

Not unless a new client side library exists without any documentation.


Kris Halsrud - Customer FX Corporation / Systems Engineer


customerfx.com
| slxdeveloper.com | goodtraining.com
Bronze Super Contributor
Posts: 252
Registered: ‎04-23-2009

Re: Problem hiding tabs at runtime Web 7.5.4

Can someone confirm that this method works in v8?

 

I am going to look into sage-platform-tabworkspace.js to see if a client-side solution is possible.

 

 

Nickel Contributor
Posts: 56
Registered: ‎10-26-2010

Re: Problem hiding tabs at runtime Web 7.5.4

Using a module you can show and hide tabs in version 8.

Employee
Posts: 24
Registered: ‎07-15-2009

Re: Problem hiding tabs at runtime Web 7.5.4

I am having issues with this at the moment. What is strange is that I was able to Show / Hide custom tabs with no issues until by boss called me yesterday saying that both said tabs werent showing in the web client. I re built the assembly and re referenced the AccountModule in AA but after deploying I am now getting the following error, we are running SLX 8.1:

 

We apologize for the inconvenience, but your request cannot be completed. Object reference not set to an instance of an object.

Saleslogix Error Id: SLXB669ADB44AA9A822

URL: http://localhost:3333/SlxClient/Account.aspx

Exception type: System.NullReferenceException

Source: Orbis.SalesLogix.Client.Account.Modules.AccountModule, AccountModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

 

My code is as follows:

 

 

using System;
using System.Collections.Generic;
using System.Text;
using Sage.Platform.WebPortal;
using Sage.SalesLogix.Client.GroupBuilder.Adapter;
using Sage.Platform.WebPortal.Services;
using Sage.Platform.WebPortal.SmartParts;
using Sage.Platform.WebPortal.Workspaces;
using Sage.Platform.WebPortal.Workspaces.Tab;
using System.Web;
using Sage.SalesLogix.Security;
using Sage.SalesLogix.Web;
using Sage.Platform.Security;
using Sage.Entity.Interfaces;
using Sage.Platform;
using Sage.Platform.Application;
using Sage.Platform.Application.UI;
using Sage.Platform.Application.UI.Web;


namespace Orbis.SalesLogix.Client.Account.Modules
{
    public class AccountModule : IModule
    {
        private IPageWorkItemLocator _pageWorkItemLocator;
        [ServiceDependency]
        public IPageWorkItemLocator PageWorkItemLocator
        {
            get { return _pageWorkItemLocator; }
            set { _pageWorkItemLocator = value; }
        }

        private IEntityContextService _EntityService;
        [ServiceDependency(Type = typeof(IEntityContextService), Required = true)]
        public IEntityContextService EntityService
        {
            get
            {
                return _EntityService;
            }
            set
            {
                _EntityService = value;
            }
        }


        #region IModule Members

        public void Load()
        {
            IAccount account = EntityFactory.GetById<IAccount>(EntityService.EntityID.ToString());
            if (account != null)
            {
                PageWorkItem workItem = PageWorkItemLocator.GetPageWorkItem();
                TabWorkspace tabWorkspace = workItem.Workspaces["TabControl"] as TabWorkspace;

                if (account.Type == "ISV")
                {
                    tabWorkspace.Hide("AccountISVApplications", false);
                    tabWorkspace.Hide("AccountTPApplications", false);
                    tabWorkspace.Hide("AccountTPApplicationsEndUser", true);
                }
                else if (account.Type == "End User")
                {
                    tabWorkspace.Hide("AccountISVApplications", true);
                    tabWorkspace.Hide("AccountTPApplications", true);
                    tabWorkspace.Hide("AccountTPApplicationsEndUser", false);
                }
                else
                {
                    tabWorkspace.Hide("AccountISVApplications", true);
                    tabWorkspace.Hide("AccountTPApplications", false);
                    tabWorkspace.Hide("AccountTPApplicationsEndUser", true);
                }
            }
        }
        #endregion
    }
}

 The event log is showing:

 

2014-09-19 13:30:03,539 [51] ERROR Sage.Platform.Application.UI.Web.ApplicationPage - Saleslogix Web Client unhandled exception [Saleslogix Error Id=SLXB669ADB44AA9A822]
{
"slxErrorId": "SLXB669ADB44AA9A822",
"mitigation": "ErrorContent (1)",
"date": "2014-09-19T13:30:03",
"utc": "2014-09-19T12:30:03",
"message": "Object reference not set to an instance of an object.",
"source": "Orbis.SalesLogix.Client.Account.Modules.AccountModule, AccountModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
"type": "System.NullReferenceException",
"stackTrace": " at Orbis.SalesLogix.Client.Account.Modules.AccountModule.Load() in c:\\Users\\Administrator\\Documents\\Visual Studio 2013\\Projects\\AccountModule\\AccountModule\\AccountModule.cs:line 54\r\n at Sage.Platform.Application.ModuleCollection.AddNew(Type moduleType) in d:\\BuildRoot\\Gobi\\SLX8.1HotFix-03\\Sources\\Sage\\Platform\\Application\\Collections\\ModuleCollection.cs:line 102\r\n at Sage.Platform.Application.ModuleCollection.AddNew[TModule]() in d:\\BuildRoot\\Gobi\\SLX8.1HotFix-03\\Sources\\Sage\\Platform\\Application\\Collections\\ModuleCollection.cs:line 84\r\n at Sage.Platform.WebPortal.WebPortalPage.RegisterModule[T](String modeMatch, String roleMatch) in d:\\BuildRoot\\Gobi\\SLX8.1HotFix\\src\\Sage\\Platform\\WebPortal\\WebPortalPage.cs:line 163\r\n at SlxClient.AccountPage.LoadModules() in c:\\inetpub\\wwwroot\\SlxClient\\Account.aspx.cs:line 391\r\n at SlxClient.AccountPage.OnLoad(EventArgs e) in c:\\inetpub\\wwwroot\\SlxClient\\Account.aspx.cs:line 119",
"targetSite": "Void Load()",
"hashCode": "6C1F184D-E7F50A56-DA3B4E2D",
"pid": 704,
"identity": {
"name": "byronb",
"isAuthenticated": true,
"authenticationType": "Forms"
},
"version": "8.1.0.1179",
"logger": {
"level": "ERROR",
"location": "Sage.Platform.Diagnostics.ErrorHelper.LogException(d:\\BuildRoot\\Gobi\\SLX8.1HotFix-03\\Sources\\Sage\\Platform\\Diagnostics\\ErrorHelper.cs:3688)",
"name": "Sage.Platform.Application.UI.Web.ApplicationPage",
"message": "Saleslogix Web Client unhandled exception [Saleslogix Error Id=SLXB669ADB44AA9A822]"
},
"request": {
"looksLikeAjax": false,
"isLocal": true,
"method": "GET",
"url": "http://localhost:3333/SlxClient/Account.aspx",
"referrer": "http://localhost:3333/SlxClient/Home.aspx",
"ipAddress": "::1",
"userAgent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36",
"userLanguages": "en-GB; en-US;q=0.8; en;q=0.6"
},
"browser": {
"type": "Chrome37",
"name": "Chrome",
"version": "37.0",
"majorVersion": 37,
"minorVersion": 0.0,
"platform": "WinNT"
},
"server": {
"machineName": "ORBSLXTEST",
"timeZone": "GMT Standard Time",
"commandLine": "C:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe -ap \"Saleslogix\" -v \"v4.0\" -l \"webengine4.dll\" -a \\\\.\\pipe\\iisipmb14051cf-24fe-48ea-883b-ed6be9a004c9 -h \"C:\\inetpub\\temp\\apppools\\Saleslogix\\Saleslogix.config\" -w \"\" -m 0",
"versionString": "Microsoft Windows NT 6.3.9600.0",
"is64BitOperatingSystem": true,
"host": {
"siteName": "Saleslogix",
"applicationId": "/LM/W3SVC/2/ROOT/SlxClient",
"applicationPhysicalPath": "c:\\inetpub\\wwwroot\\SlxClient\\",
"applicationVirtualPath": "/SlxClient",
"isDebuggingEnabled": true,
"isHosted": true,
"maxConcurrentRequestsPerCPU": 5000,
"maxConcurrentThreadsPerCPU": 0
},
"logonUser": {
"name": "ORBSLXTEST\\WebDLL",
"authenticationType": "Forms",
"impersonationLevel": "Impersonation",
"isAnonymous": false,
"isGuest": false,
"isSystem": false
}
}
}

 

 

Any help would be greatly appreciated

Highlighted
Bronze Super Contributor
Posts: 177
Registered: ‎04-27-2009

Re: Problem hiding tabs at runtime Web 7.5.4

I would add checks for entityservice actually having an ID

if(EntityService!=null && EntityService.EntityID!=null)


Kris Halsrud - Customer FX Corporation / Systems Engineer


customerfx.com
| slxdeveloper.com | goodtraining.com
Employee
Posts: 24
Registered: ‎07-15-2009

Re: Problem hiding tabs at runtime Web 7.5.4

Thanks Chris, I added the check and it would seem we dont have an ID available. Strange thing is that both tabs are now not visible and if I try and go through records I get the following error:

Sys.InvalidOperationException: Could not find UpdatePanel with ID 'TabControl_element_AccountTPApplications_update_panel_AccountTPApplications'. If it is being updated dynamically then it must be inside another UpdatePanel.
Employee
Posts: 24
Registered: ‎07-15-2009

Re: Problem hiding tabs at runtime Web 7.5.4

Thanks for the help Chris, managed to get it working again!