Skip to main content
madhusudant8411
July 7, 2025
Question

Related records filtering

  • July 7, 2025
  • 4 replies
  • 1 view

I have a readonly grid with a record as a source. This record Lets say "Main Record" is having a relation ship with other record - "Related Record". Grid has fields from both records. When Applying filters I want to avoid getting records from "Related Record" which are not active. Lets take below sample data of "Related Record". Relationship is one to Many.

ID_MainRecord Division Is Active
1 Sports 0
1 Study 1

I have applied filter as 

a!queryFilter(

field:Main Record.Related Record.Division

Operator: =

Value: "Sports"

),

a!queryFilter(

field:Main Record.Related Record.isActive

Operator: =

Value: true

)

Still I am getting one record in Grid I am expecting no records at all. And the record I am getting is having "Study" in division grid field. How can I get it work.  Some how how the first filter is not working as "Sports is there in the relationship field I guess.

Thanks in advance for your attention.

    4 replies

    stefanhelzle0001
    July 7, 2025

    Do you combine the filters using an AND or an OR?

    madhusudant8411
    July 7, 2025

    Its in "And" my filter structure is as below.

    filter:a!queryLogicalExpression(

    operator "AND"

    logicalexpression:"Some Filter in Or Condition",

    filters:the above filters with some more filters.

    )

    The filter is working fine if I don't have the inactive value in related record like if My data is as follows

    1 Study 1

    Then I am not getting this record, which is expected. 

    stefanhelzle0001
    July 7, 2025

    The example in your first post clearly shows a result I would expect when combining the two filters using an OR. I suggest to simplify your filters to identify the issue.