back to top

Infor CRM (Formerly Saleslogix) Iterating through all tabs on a Page

Using the TabWorskpace you can iterate through all the tabs on a page and do something with them, like show or hide them.  To do this you need the following code:

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

protected void QuickFormLoad0()
{
    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)
        {            
            foreach (Sage.Platform.WebPortal.Workspaces.Tab.TabInfo sp in tabContentWorkspace.Tabs)
            {                
                tabContentWorkspace.Hide(sp.ID, true);   
            }
        }
    }
    catch { }
}
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.

10 COMMENTS

  1. Hi Kris,

    For the Account page, what quick form’s Load action holds the code snippet? QuickFormLoad0 of AccountDetails OR QuickFormLoad0 of any tabs?

    Thanks
    xdp

  2. Our Infor CRM web is 8.3. Actually, I want to customize the code to set default tab. For example, when opening Account page, the Contacts tab is displayed by default. Is it possible?

    • The default tab is based on settings stored in the VFS table for each user. The path for this setting in the VFS for the admin user would be: \Configuration\Application_User\SlxClient\admin\ASP.account_aspxDetail\TabWorkspace-E53DA2EE-942A-4b9d-8885-55C2EF1A4E4A.xml

      Inside the xml of that is a node ActiveMainTab which stores the smart part name of the tab that is defaulted.

      I think you would somehow need to update this VFS record for each user on the load of the account form. I am not sure if that would happen early enough to make the tab the active one or if it would happen too late. Never tried doing this specifically.

  3. Using your code for hiding/showing tabs, we can get the tab collection of the current Account, right? From the tab collection, is it possible to locate a certain tab which we want and then set it as displayed (active?) with code (e.g. a method) on the fly?

    • Not sure but I doubt it. The tab selection is client side and this would be server side code. I would guess the only server side way would be as I mentioned to change the default tab in the VFS settings prior to the tabs being opened. Perhaps with client side jscript you could do so, but not sure.

  4. foreach (Sage.Platform.WebPortal.Workspaces.Tab.TabInfo sp in tabContentWorkspace.Tabs)
    ———————————-

    tabContentWorkspace.Tabs is a tab collection, right?

    For this line, sp is Tabinfo. Is there a method or property which can return tab?

  5. Maybe can use tabContentWorkspace.Activate(object smartpart), but don’t know how to get/create the smartpart object, e.g. the object of Contacts quickform.

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