back to top

Infor CRM (Formerly Saleslogix) Hiding Tabs at Runtime Without Using Modules

 As Ryan wrote a long time ago, you can create a module and add it to a page in the Infor CRM web client to show or hide things like menus, or tabs.

Problem is that this functionality doesn’t work well starting in 8.1 with update 05 as the modules no longer run as you switch records client side, using the group pane or VCR group navigator buttons.  This means the module runs the first time you open the page but not subsequently as you switch records unless you do a full refresh again.  This problem is detailed here.

Creating modules seems overkill and a big pain to make this happen.  What you can do instead is to use similar code either directly on a quick form, in the load action, or by creating a global code file in the app_code folder and then calling that directly. 

To load it onto a quick form you need to get a little creative.  Quick forms only offer the ability to add a single function at a time and we will need to add some variables and service dependencies.  This can be done by messing with how quick forms get rendered.  if you think about when you add code to the load action you simply type in the code you want and then when the smart part is constructed it wraps your code in a code stub.  So if you did something like this in a load action:

string myVar = “hello there”;

When the quick form is deployed it becomes

protected void QuickFormLoad0 ()

{

   string myVar = “hello there”;

}

So what this means is we can add our own code and add an extra } at the end, that way we could type something like:

   string myVar = “hello there”;

}

protected void myCoolFunction()

{

string myVar = “I fooled  Saleslogix.  Yah!”;

That way when it is built we end up with

protected void QuickFormLoad0 ()

string myVar = “hello there”;

}

protected void myCoolFunction()

{

string myVar = “I fooled  Saleslogix.  Yah!”;

}

 The important thing to notice is I add one extra } after my load action code and leave off the closing } after my custom function.

On to the details

So with knowing that, lets take a look at how we do this:

The first thing is to add our code that will run on the load action:

    Sage.Platform.WebPortal.Workspaces.Tab.TabWorkspace tabContentWorkspace = null;
    try
    {
        string id = string.Empty;
        tabContentWorkspace = this._parentWorkItem.Workspaces[“TabControl”] as Sage.Platform.WebPortal.Workspaces.Tab.TabWorkspace;
        Sage.Platform.Application.IEntityContextService entityContext = this._parentWorkItem.Services.Get<Sage.Platform.Application.IEntityContextService>();
        if (entityContext.HasEntityContext)
        {
            id = entityContext.EntityID.ToString();
        }
        Sage.Entity.Interfaces.IAccount buyer = Sage.Platform.EntityFactory.GetById<Sage.Entity.Interfaces.IAccount>(id);

        if (tabContentWorkspace != null && buyer != null && !string.IsNullOrEmpty(buyer.Type))
        {
            string type = buyer.Buyer.ToLower();
            foreach (Sage.Platform.WebPortal.Workspaces.Tab.TabInfo sp in tabContentWorkspace.Tabs)
            {               
                tabContentWorkspace.Hide(“someTabID”, type == “prospect”);  
            }
        }
    }
    catch (Exception exception)
    {
       throw new Sage.Platform.Application.ValidationException(“oops we have a problem”);
    }

}

Again notice, I have an extra } at the end.  Now right below this we need to add some dependencies our code is using:

private Sage.Platform.Application.UI.UIWorkItem _parentWorkItem;
[Sage.Platform.Application.ServiceDependency(Type = typeof(Sage.Platform.Application.WorkItem))]
public Sage.Platform.Application.UI.UIWorkItem ParentWorkItem
{
    get
    {
        return this._parentWorkItem;
    }
    set
    {
        this._parentWorkItem = value;
    }

Again, notice I have left off the last closing bracket.

This code sample assumes this is running on the account screen and will run when the quick form loads and hide the smart part tab called “someTabID” when the current account’s type=”Prospect”

Please note I have only had success using this when there are no other modules on the page :(.  Using on a standard screen like Account details doesnt seem to work as other modules override what we are doing here, so for thos a module approach is still the way to go.  BOOO!

 

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos