back to top

Adding a Filter/Condition to the Contact Attendees Lookup in the Infor CRM Activity Editor Dialog

I’ve posted a few times before about customizing the Infor CRM (Saleslogix) Activity Editor Dialog. It’s a form made up of 100% Javascript so customizing it isn’t like your typical Infor CRM Web customizations. In this article, we’ll be looking at how to customize the lookup to add contact attendees (participants) to the activity. Specifically, we’ll be adding a condition to filter that lookup by the contact’s title, allowing only contacts with a particular title to be added as attendees.

Before we look at the code, I will be using my Custom Script Loader Module that I have blogged about previously. Visit the link below, download the bundle and install it. The module that bundle installs allows us to simply drop a Javascript file into a folder without the need to wire it up in the master page.

Get the Custom Script Loader Module
Note: There’s a link to the bundle at the bottom of the page when you follow this link. Just install the bundle and you’re set.

Once the Custom Script Loader Module is installed, if you look in the SlxClient portal in AA, under SupportFiles, you’ll see a new folder named Custom. Inside that folder there is a folder named Modules. We’re going to be placing our custom code there. Inside the Custom/Modules folder, let’s create a new folder named “ActivityAttendees”. Inside this new folder, add a new text file and name it main.js. We’ll be adding this code inside that folder.

define([
    'dojo/_base/declare',
    'dojo/_base/lang',
    'Sage/MainView/ActivityMgr/ActivityEditor'
], 
function (declare, lang, ActivityEditor) {
     
    function initializeActivityAttendees() {
     
        lang.extend(Sage.MainView.ActivityMgr.ActivityEditorAttendeesTab, {
	
            lookupContacts: function () {
                this.lup_Contact.seedProperty = 'Account.Id',
                this.lup_Contact.seedValue = this.actEditor._activityData.AccountId;

                // This is the line we are changing to add our condition to the lookup.
                // In this sample code, we're adding a condition to only allow adding 
                // contacts with a title of "President" or "Owner".
                this.lup_Contact.query.conditions = 'Title in ("President", "Owner")';
 	
                this.lup_Contact.buildSDataStoreQueryForSeeding();
                this.lup_Contact._originalQueryConditions = this.lup_Contact.query.conditions;
                this.lup_Contact.cancelText = this.lup_Contact.closeText;
                this.lup_Contact.overrideSeedValueOnSearch = true;
                this.lup_Contact.showLookup();
                var handle = dojo.connect(this.lup_Contact.lookupDialog, 'onHide', this.lup_Contact, function () {
                    dojo.disconnect(handle);
                    if (this.seedValue) {
                        this.resetGrid();
                    }
                });
            }
 
        });
        
    }
     
    // run customizations 
    initializeActivityAttendees();
});

So what exactly are we doing here? If we look in the code that makes up the Attendees (participants) tab, located in jscript/Sage/MainView/ActivityMgr/ActivityEditorAttendeesTab.js, you’ll see a function named lookupContacts on line 472. This is the code that fires when you click on the button to lookup (or add) a contact attendee to the activity. We’re overriding (replacing) that entire function with our own so that we can set the condition for the lookup (if the out of the box code didn’t specifically set the condition for the lookup to empty on line 475, we could have just done an aspect.before to add that without needing to replace the entire function. Once we’ are replacing that function, we can do whatever we want there. In the sample code above we’re just setting the condition to filter the lookup to only show contacts with a title of “President” or “Owner”. In the end, this article isn’t so much about how to restrict that lookup, but more about showing how to customize the areas of the activity editor by overriding functions with your own.

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
Ryan Farley
Ryan Farleyhttps://customerfx.com/article/author/ryanfarley/
Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

4 COMMENTS

  1. Good Afternoon, I have a problem with a customization of activity, I try to replace the Category picklist, and I need to hide this field and show the new Category Lookup.

    When I use this instruction this.pk_Category.set(‘readonly’, true); or this.pk_Category.set(‘visible’, false); the aplication doesn’t work, I use these instruction in the custom module.

    This is the code:

    define([
    ‘dojo/ready’,
    ‘dojo/_base/declare’,
    ‘dojo/aspect’,
    ‘dojo/_base/lang’,
    ‘Sage/MainView/ActivityMgr/ActivityEditor’,
    ‘Sage/MainView/ActivityMgr/HistoryEditor’,
    ‘Sage/Services/ActivityService’,
    ‘Sage/UI/Controls/Lookup’
    ],
    function (ready, declare, aspect, lang,
    ActivityEditor, HistoryEditor, ActivityService, Lookup) {

    function initializeActivityEditor()
    {

    this.pk_Category.set(‘visible’, false);
    }
    initializeActivityEditor();
    //}
    });

    Please, I need your help.

    Regards.

    • Iveth,

      When your script is getting executed the dialog doesn’t even exist yet so there is no category control to hide. You need to add code so you are attempting to hide it in an event on the ActivityEditor dialog after it has been created already such as _manualBind or postCreate. Try something like this instead:

      define([
      ‘dojo/_base/declare’,
      ‘dojo/_base/lang’,
      ‘Sage/MainView/ActivityMgr/ActivityEditor’
      ],
      function (declare, lang, ActivityEditor) {

      function initializeActivityCustomizations() {

      lang.extend(Sage.MainView.ActivityMgr.ActivityEditor, {

      postCreate: function () {
      Sage.MainView.ActivityMgr.ActivityEditor.superclass.postCreate.apply(this, arguments);
      // add custom code here
      }

      });

      }

      // run customizations
      initializeActivityCustomizations();
      });

  2. Hi Ryan,

    Is this javascript still active in version 8.3.0.6? I am trying to modify the speedsearch lookup in SpeedSearchLookup.js for participants (add columns, increase width) and nothing I do to has any affect.

    Steve

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