Bar chart user filter validation

Hi there !

So... I've created a bar chart with some custom fields filters. Now, I'm trying to create a validation for 2 date fields, since they're about date interval and I wanna validate if the second one isn't greater than first one, for example.

I created some validations on field, using "validations" property. It shows error mesage, but still filter chart's data.

Here is the point: I wanna prevent it. Doing a analogy to web development, I wanna prevent the load event.

Is it possible ?

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Hi Bruno,

    Given what you're looking for I would do an if() statement within the saveInto. Something like the below. You can also have an validation parameter that shows up as expected when this happens so the user knows, you'd just have to validate based on the tempDate variable.

    saveInto: {
    local!tempDate,
        if(
            local!tempDate>local!dateTwo,
            a!save(local!tempDate, null),
            a!save(local!dateOne, local!tempDate)
        )
    }