help with addFoundSetFilterParam()

I have an integer field that by default the field is
In order to set the record as “active” or “inactive” there is a check box to indicate “inactive” If the check box is selected the filed is set to 1 = “inactive”

When I need to set the record back to “active” I un-select the check box. The filed now set to 0 - the problem is when I run the filter to show/hide inactive records the records with a value of 0 are still showing as “inactive” and should show as “active”, just like the records that have a value.

function setDataFilterActive() {
	if (inActive) {
		foundset.removeFoundSetFilterParam('active')
		foundset.loadAllRecords()
	} else {
		foundset.addFoundSetFilterParam('inactive_field','is null','null','active')
		foundset.loadAllRecords()
	}
}

Thanks in advance for any help with this,
Bob

Hi Bob,

I saw somewhere this on this forum : foundset.addFoundSetFilterParam(‘inactive_field’,‘^||=’,0,‘active’)
which means (inactive_field is null or inactive_field=0)

As said before : too bad that the Servoy Wiki is not accurate/complete/…

Regards,

Thank you Lambert,

You pointed me in the right direction! I needed to tweek your suggestion a little so the code that worked was:
foundset.addFoundSetFilterParam(‘inactive_field’,‘^||=’,‘null’,‘active’)

Simply does not like the ‘0’

I agree the Wiki could be a bit clearer.

Thanks again,
Bob