Filter results are missing for export parameter 'supplier'

Hi everyone,

I’m working on setting up an export definition with multiple filters, and I’m running into a strange issue. I’ve created three filters:

  • filter_customer
  • filter_supplier
  • filter_bta_owner

The filter_bta_owner and filter_customer are working as expected — the filter expression is applied and the dropdown is populated correctly. However, for the supplier export, although the link between the export parameter and filter is in place, the filter expression doesn’t seem to be working. The dropdown remains empty.

Here’s what I’ve configured:

  1. Overview of the filters
    (see screenshot below – export report parameters)

  2. Export parameter linked to the filter

  3. ‘Supplier’ filter settings

  • Value expression: this.creditor_number.tostring().concat(" ").concat(this.contact_name)
  • Filter expression: this.is_supplier.equals(yesno:load(1))
  • Sort expression: [this.creditor_number.asc]
  • Default value expression: contacts:getnull()


  1. Working BTA filter for comparison


Question:
Has anyone run into this issue before where the filter expression is set but not being applied in the export? The settings appear to be the same as the working BTA filter, but I still get an empty dropdown for suppliers.

Would appreciate any ideas or suggestions. Thanks in advance!

Hi Daniël,

We looked into this together and we identified that there was no technical issue, but your expression worked different than you expected.

You were running an Export Report. The Export Definition was parameterized; the filters were set in the Export report.

In your specific case, this was your expression:

{
 pricingdeviationline,
 this,
  boolean:and([
  boolean:or([
    this.contact.equals(%contact),
    boolean:and([
     %contact.isnull(),
     this.contact.contact_belongs_to.equals(%bta_owner),
     this.contact.is_active.equals(yesno:load(1))
    ])
  ]),
  boolean:or([this.product.default_supplier().equals(%supplier),%supplier.isnull()])
  ])
}

Your filter values (parameters) were:

[
 <"contact",contacts:getnull()>, 
 <"bta_owner",contacts:load(9)>,
 <"supplier",contacts:getnull()>
]

We analyzed the expression and identified that this expression would always return falsebecause these part returned false within AND.

     %contact.isnull(),
     this.contact.contact_belongs_to.equals(%bta_owner),

We changed the expression to this, and it behaved as you expected:

{pricingdeviationline ,this, boolean:and([
boolean:or([
  this.contact.equals(%contact),
  boolean:and([
   %contact.isnull(),
   boolean:or([this.contact.contact_belongs_to.equals(%bta_owner),%bta_owner.isnull()]),
   this.contact.is_active.equals(yesno:load(1))
  ])
]),
boolean:or([this.product.default_supplier().equals(%supplier),%supplier.isnull()])
])
}

Why, how and expression debugger

When we walked through this expression together, we discussed the following topics:

  1. NULL does not equals NULL, except for Strings
    2. contacts:getnull().equals(contacts:getnull()) = FALSE
    3. int:getnull().equals(int:getnull()) = FALSE
    4. string:getnull().equals(string:getnull()) = TRUE
  2. Checking if a value is NULL goes like this:
    1. contacts.isnull() = TRUE when a contact is null

Then, within an OR, you can say:

A single TRUE within an OR, makes that the full OR is TRUE

A single FALSE within an AND, makes that the full AND is FALSE

This can be seen in a nice way in the Expression debugger, which also allows you to provide parameters, at “Placeholders”. (bottom left)

Now when you click

  1. Profile
  2. Optimizing

You can see how the expression is pre-analyzed, eliminating all obvious parts:

This makes that you can see the expression evaluation.