I have seen mixed responses throughout the forums on the use of the FilterExpression.
I am trying to make sure that a News List includes only news articles that are between two dates, the DateOfPublication and the ExpirationDate - both custom fields.
In the NewsFrontendList's FilterExpression attribute, I entered the following condition:
Visible = true AND Status = Live AND DateOfPublication <= DateTime.UtcNow AND (ExpirationDate = NULL OR ExpirationDate > DateTime.UtcNow)
This results in an error "Error parsing the template"
Some of the posts mention the lack of support for "OR" in the FilterExpression.
To experiment with this, I placed a default value of "1/1/1900" in the ExpirationDate field and changes the FilterExpression to:
Visible = true AND Status = Live AND DateOfPublication <= DateTime.UtcNow AND (ExpirationDate < (1/1/1900 23:59) OR ExpirationDate > DateTime.UtcNow)
Since the latter worked, I have no doubt that the FilterExpression now supports "OR".
What I am still looking to do is instead of require a date, I would like the former, or some variant thereof, to work.
I would preferably like to resolve this without a coding solution. Anyone?