back to top

SalesLogix Web Client – Determining the selected records in the list view

The SalesLogix web client uses the ext-js library for the SalesLogix groups.  Finiding out what records are selected in the group is not that obvious.  This post will walk you through what you need to do in order to determine what records are selected.

Determining record selected is really a two step process – the first is a client side call to set a SalesLogix client side library with the records selected, the second part is to actually do something with them.  The client side library does expose working with the records selected, but I am going to show you how to use the client side selected records to do something server side.

The first step is to create the client side function to store the selected records.  In this example I am going to add a task to the common task area of the task pane.  Because of this I will be adding my client side function right to the CommonTasksTasklet.acsx file.  In the existing javasript tag of the ascx file I will create the following function:

function FXGetSelections(){
    var selectionInfo = GetSelectionInfo();
    document.getElementById(clientID + ‘_hfSelections’).value = selectionInfo.key;
    var svc = Sage.Services.getService(‘SelectionContextService’);
    svc.setSelectionContext(selectionInfo.key, selectionInfo, false);
}

 This function uses the SelectionContextService and sets the current selections into it.

 Now on the ascx.cs file we need to do two things:

  1. Create a task on the common task area to that can invoke an event after I select my records.
  2.  Wire up the server side code to do something with the selected records.

The first thing I am going to do is add a common task to the Account area.  This is done in the FillListViewDictionaries method.  If you look the first block of code is defining the account list tasks.  I am going to add the line of code shown below in bold.  Make note that the tasks are comma delimited so you need to change the existing last task’s line to remove “};” and change it to “,”

         string[,] accountListTasks =
            {{“tskAddToGroup”, “TaskText_AddToGroup”,”javascript:showAdHocList(Ext.EventObject);”, “false”},
             {“tskSaveAsNewGroup”,”TaskText_SaveAsNew”,”javascript:saveSelectionsAsNewGroup();”,”false”},
             {“tskRemoveFromGroup”,”TaskText_Remove”,”javascript:removeSelectionsFromGroup();”,”false”},
             {“tskPromote”, “TaskText_Promote”, “javascript:promoteGroupToDashboard();”, “false”},
             {“tskExportToExcel”, “TaskText_Export”, “javascript:exportToExcel();”, “false” },
           {“tskTest”,”TaskText_Test”,”javascript:FXGetSelections()”,”false” }};
        tasksByEntityList.Add(“IAccount”, accountListTasks);

Also, make not that the second parameter is a string corresponding to an entry in the ascx resource file.  You will need to add an entry corresponding to this in the resource file.  I will not go over this here.

As you can see, the third parameter in the line added is a call to my custom client side function.  As of right now we have a working page but it will not do anything until we wire up the server side code.  To do this we need to look for a method in the cs file called “items_ItemCommand”.  In this method is a large case statement that determines which task is clicked based on the task name (parameter 1 in the FillListDictionaries method).  Here we will add a new case block of code at the end of the existing code like so:

case “tskTest”:
    tskTest_Command();
    break;

Here I am invoking a new method called “tskTest_Command”.  Lets create that now.

    void tskTest_Command()
    {
        GroupContextService groupContextService = ApplicationContext.Current.Services.Get<IGroupContextService>() as GroupContextService;
            CachedGroup currentGroup = groupContextService.GetGroupContext().CurrentGroupInfo.CurrentGroup;
            GroupInfo gInfo = currentGroup.GroupInformation;

            string passedArgument = hfSelections.Value;
        ISelectionService srv = SelectionServiceRequest.GetSelectionService();
        ISelectionContext selectionContext = srv.GetSelectionContext(passedArgument);
        IList<string> selections = selectionContext.GetSelectedIds();
        string msg = “”;
        foreach (string id in selections)
        {
            msg += id + “,”;
        }
        throw new Sage.Platform.Application.ValidationException(msg);
    }

Here we have server side code working with the SelectionService that we populated client side.  In this case I am simply building a list of Ids selected and then displaying that list to the user.

There you have it.  A process for getting the client side selections in the SalesLogix group view and working with them server side!

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.

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