I need a custom record field, of which the value is the result of query, can we do any query in custom record field
Discussion posts and replies are publicly visible
No you cannot use query in a custom record field.
You have limited functions to use in sync time and real time evaluation, queryEntity is not among that.