Relativity is a .NET server. Unfortunately it is not allowed to use MacroExpression in dynamic where for .NET servers. Wiki article quote:
"Please note that a WhereExpression containing a MacroExpression cannot be used to perform Dynamic Where clauses due to security restrictions (allowing it would enable SQL injection attacks via Dynamic Where).
In the case of Relativity server you couldn’t implement proposed workaround, because it is not possible to create services for it.
So you could either implement custom Delphi server and use MacroExpression without any restrictions or implement custom .NET server with proposed workaround.