Adding a Lookup to Select from Users in Creatio (formerly bpm’online)

If you’re adding a Contact lookup where you want the user to chose from user contacts only, instead of all users in the system, you’ll add a normal Contact lookup that gets filtered to show only contacts that are users. I’ve shown before how to filter a lookup, but for filtering for user contacts, there’s a useful way that exists out of the box that makes this a simple task.

Creatio has a module you can use called BaseFiltersGenerateModule. This module creates the filters needed for a contact lookup to show only users (among other filters). To use this, you’ll just add this module to the modules list at the top of the page schema:

define("MyEntityPageV2", ["BaseFiltersGenerateModule"], function(BaseFiltersGenerateModule) {

Now, you’ll need to add your lookup to the attributes, similar to how I outline in the article to filter lookups (in this sample, my lookup column is named “UsrAssginedTo”):

attributes: {
    "UsrAssignedTo": {
        dataValueType: Terrasoft.DataValueType.LOOKUP,
        lookupListConfig: { filter: BaseFiltersGenerateModule.OwnerFilter }
    }
}

The key there is that the filter added to the lookupListConfig with a value of BaseFiltersGenerateModule.OwnerFilter. The “OwnerFilter” in the BaseFiltersGenerateModule module defines the ESQ filters needed to filter the contact lookup to only show contacts that are users.

 

ABOUT THE AUTHOR

Ryan Farley

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.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!