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.



