Creating a Custom Lookup Filter with Complex Conditional Logic

Hello Creatio Community,

I’m trying to implement a custom filter for a contacts dropdown on my mini page, and I need help constructing it properly.

The filter has two main conditions combined with AND:

  1. The first condition itself has two sub-conditions depending on whether a certain column is null or not:
    • If the column is not null, get a string value from the related column1id table and compare it with the contacts.
    • If the column is null, get an ID value from the related column2id table, then use that ID to retrieve a string for comparison with the contacts dropdown.
  2. The second condition involves a specific field ID:
    • Use this ID to filter contacts who have a checkbox selected that corresponds to this ID.

How would you tackle retrieving data from data source? How can I build a filter that applies these conditions properly with AND logic between them? 

 

Edit: Question no.  2:
Would it be possible to do all the filtering logic in JS (manually send a query to the database) and somehow push the result to the dropdown as datasource?

Like 8

Like

2 comments

Hello,

Could you please clarify if you are setting up a Business rule or an advanced filter in a group/folder?

Mira Dmitruk,

Hello,

I am creating a filter using JavaScript in the page Source Code. Something similar to this, but more complex filter logic with JOIN to more than one tables:
Filtering a lookup in Freedom UI - Help needed | Community Creatio

Show all comments